/* ==========================================================================
   ÁREA DE MEMBROS — protótipo
   Mesmo sistema do site (Marcellus, Golos Text, tinta #0D1018, vermelho
   #E0020D, raio 2px). Barra lateral escura no desktop, separadores em baixo
   no telemóvel. Só transform/opacity/cores em movimento.
   ========================================================================== */
.app { background: var(--bg); min-height: 100vh; }
.app__proto {
  position: sticky; top: 0; z-index: 70;
  padding: 8px var(--pad); text-align: center;
  background: #FCEBEC; color: #7A0A10; font-size: 13px; line-height: 1.45; letter-spacing: 0;
}
.app__proto a { text-decoration: underline; text-underline-offset: 3px; }
.app__proto-short { display: none; }
@media (max-width: 809px) { .app__proto-long { display: none; } .app__proto-short { display: inline; } }
.ex {
  display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 8px 1px;
  border-radius: 100px; background: rgba(13, 16, 24, .07); color: rgba(13, 16, 24, .62);
  font: 500 11px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase;
}

/* Botões da app */
.app__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px; border-radius: 2px; flex: none;
  font-size: 15px; letter-spacing: -.01em; white-space: nowrap;
  background: rgba(13, 16, 24, .06); color: var(--ink);
  transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out);
}
.app__btn:active { transform: scale(.97); }
.app__btn--solid { background: var(--ink); color: var(--white); }
.app__btn--ghost { background: transparent; box-shadow: inset 0 0 0 1px rgba(13, 16, 24, .18); }
.app__btn.is-done { background: #E6F4EC; color: #0F7A3F; box-shadow: none; }
.app__btn.is-done::before { content: ""; width: 12px; height: 7px; border: solid currentColor; border-width: 0 0 1.6px 1.6px; transform: translateY(-2px) rotate(-45deg); }
@media (hover: hover) and (pointer: fine) {
  .app__btn:hover { background: rgba(13, 16, 24, .1); }
  .app__btn--solid:hover { background: #1d2230; }
  .app__btn--ghost:hover { background: rgba(13, 16, 24, .05); }
  .app__btn.is-done:hover { background: #E6F4EC; }
}
.app__link { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink); margin-top: 14px; }
.app__link svg { width: 14px; height: 14px; }

/* Entrada */
.gate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: calc(100vh - 36px); }
.gate[hidden] { display: none; }
.gate__card { align-self: center; justify-self: center; width: min(440px, 100% - 2 * var(--pad)); padding: 48px 0; display: flex; flex-direction: column; gap: 16px; }
.gate__logo { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.gate__logo img { width: 28px; height: 28px; }
.gate__logo span { font-family: var(--display); font-size: 22px; letter-spacing: -.01em; }
.gate h1 { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 34px + 1.6vw, 56px); line-height: 1.05; letter-spacing: -.04em; }
.gate__card > p { font-size: 17px; line-height: 1.5; color: rgba(13, 16, 24, .7); }
.gate__form { display: grid; gap: 10px; margin-top: 12px; }
.gate__form label { font-size: 15px; }
.gate__form input { height: 48px; padding: 0 14px; border: 0; border-radius: 2px; background: var(--white); box-shadow: inset 0 0 0 1px rgba(13, 16, 24, .14); font-size: 16px; }
.gate__form input:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.gate__form .app__btn { min-height: 48px; font-size: 16px; }
.gate__note { font-size: 14px; color: rgba(13, 16, 24, .55); }
.gate__alt { font-size: 15px; margin-top: 8px; }
.gate__alt a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.gate__art { position: relative; overflow: hidden; background: var(--ink); }
.gate__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.gate__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(13, 16, 24, .55), rgba(13, 16, 24, 0) 60%); }

/* Estrutura */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 36px); }
.shell[hidden] { display: none; }
.side {
  position: sticky; top: 36px; height: calc(100vh - 36px);
  display: flex; flex-direction: column; gap: 32px; padding: 28px 16px 20px;
  background: var(--ink); color: var(--white);
}
.side__logo { display: inline-flex; align-items: center; gap: 10px; padding: 0 10px; }
.side__logo img { width: 24px; height: 24px; }
.side__logo span { font-family: var(--display); font-size: 19px; white-space: nowrap; }
.side__nav { display: grid; gap: 2px; }
.app__nav-btn {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border-radius: 2px; font-size: 16px; text-align: left;
  color: rgba(255, 255, 255, .7); transition: background-color 160ms ease, color 160ms ease;
}
.app__nav-btn svg { width: 20px; height: 20px; flex: none; }
.side .app__nav-btn.is-on { background: rgba(255, 255, 255, .08); color: var(--white); }
.side .app__nav-btn.is-on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--red); }
@media (hover: hover) and (pointer: fine) { .side .app__nav-btn:hover { color: var(--white); background: rgba(255, 255, 255, .05); } }
.side__out { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 11px 12px; font-size: 15px; color: rgba(255, 255, 255, .55); }
.side__out svg { width: 20px; height: 20px; }

.main { padding: 48px clamp(20px, 4vw, 56px) 80px; max-width: 1180px; width: 100%; }
.main:focus { outline: none; }
.view[hidden] { display: none; }
.view.is-on { animation: viewIn 200ms var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view__head { margin-bottom: 32px; }
.view__eyebrow { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.view__head h2 { margin-top: 8px; font-family: var(--display); font-weight: 400; font-size: clamp(36px, 30px + 1.6vw, 52px); line-height: 1.1; letter-spacing: -.04em; }
.view__sub { margin-top: 8px; font-size: 17px; color: rgba(13, 16, 24, .65); }
.block__title { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: rgba(13, 16, 24, .55); margin-bottom: 14px; }

/* Início */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.feed { display: grid; gap: 12px; }
.feed__item { background: var(--white); border-radius: 2px; padding: 22px 24px; box-shadow: 0 1px 2px rgba(13, 16, 24, .04), 0 0 0 1px rgba(13, 16, 24, .05); }
.feed__tag { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgba(13, 16, 24, .55); }
.feed__tag--red { color: var(--red); }
.feed__item h3 { margin-top: 8px; font-family: var(--display); font-weight: 400; font-size: 23px; line-height: 1.25; letter-spacing: -.02em; }
.feed__item > p:not(.feed__tag) { margin-top: 6px; font-size: 16px; line-height: 1.5; color: rgba(13, 16, 24, .7); }
.feed__more { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 15px; }
.feed__more svg { width: 14px; height: 14px; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .feed__more:hover svg { transform: translateX(3px); } }
.home__side { display: grid; gap: 12px; position: sticky; top: 72px; }
.next { background: var(--ink); color: var(--white); border-radius: 2px; padding: 24px; display: grid; gap: 8px; }
.next__label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.sugg .next__label { color: rgba(13, 16, 24, .55); }
.next h3 { font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: -.02em; }
.next__when { font-size: 15px; color: rgba(255, 255, 255, .7); }
.next__count { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 8px; }
.next__count span { display: grid; gap: 2px; padding: 12px 10px; border-radius: 2px; background: rgba(255, 255, 255, .06); font-size: 12px; letter-spacing: .04em; color: rgba(255, 255, 255, .6); text-align: center; }
.next__count b { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: -.02em; color: var(--white); font-variant-numeric: tabular-nums; }
.next .app__btn--solid { background: var(--white); color: var(--ink); }
.next .app__btn.is-done { background: #E6F4EC; color: #0F7A3F; }
.sugg { background: var(--white); border-radius: 2px; padding: 22px 24px; box-shadow: 0 0 0 1px rgba(13, 16, 24, .05); }
.sugg ul { display: grid; gap: 14px; margin-top: 14px; }
.sugg li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: rgba(13, 16, 24, .6); line-height: 1.35; }
.sugg li b { display: block; font-weight: 500; font-size: 15px; color: var(--ink); }

/* Avatares */
.person__av {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink-card); color: var(--white);
  font-family: var(--display); font-size: 15px; letter-spacing: 0;
}
.people .person:nth-child(3n+2) .person__av, .sugg li:nth-child(2) .person__av { background: var(--red); }
.person__av--lg { width: 64px; height: 64px; font-size: 22px; }

/* Filtros */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 100px; font-size: 14px; letter-spacing: 0; box-shadow: inset 0 0 0 1px rgba(13, 16, 24, .16); transition: background-color 160ms ease, color 160ms ease; }
.chip.is-on { background: var(--ink); color: var(--white); box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .chip:not(.is-on):hover { background: rgba(13, 16, 24, .05); } }

/* Eventos */
.view .chips + .evs { margin-top: 20px; }
.evs { display: grid; gap: 10px; }
.ev { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 20px; align-items: center; background: var(--white); border-radius: 2px; padding: 18px 20px; box-shadow: 0 0 0 1px rgba(13, 16, 24, .05); }
.ev[hidden] { display: none; }
.ev__date { display: grid; justify-items: center; padding: 10px 6px; border-radius: 2px; background: var(--bg); }
.ev__date b { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1; letter-spacing: -.02em; }
.ev__date span { margin-top: 4px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: rgba(13, 16, 24, .6); }
.ev[data-reserved] .ev__date { background: #FCEBEC; color: var(--red-deep); }
.ev__body h3 { font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.25; letter-spacing: -.02em; }
.ev__body p { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 15px; color: rgba(13, 16, 24, .62); }
.ev__pin { width: 15px; height: 15px; flex: none; }
.ev[data-reserved] .ev__body h3::after { content: "Reservado"; margin-left: 10px; vertical-align: middle; padding: 2px 8px 1px; border-radius: 100px; background: var(--red); color: var(--white); font: 500 11px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.ev__done { font-size: 14px; color: rgba(13, 16, 24, .5); }

/* Materiais */
.mats { display: grid; gap: 10px; }
.mat { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 18px; align-items: center; background: var(--white); border-radius: 2px; padding: 18px 20px; box-shadow: 0 0 0 1px rgba(13, 16, 24, .05); }
.mat__ico { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 2px; background: var(--bg); }
.mat__ico svg { width: 22px; height: 22px; }
.mat--locked .mat__ico { background: #FCEBEC; color: var(--red); }
.mat__type { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgba(13, 16, 24, .55); }
.mat h3 { margin-top: 4px; font-family: var(--display); font-weight: 400; font-size: 20px; line-height: 1.25; letter-spacing: -.02em; }
.mat h3 + p { margin-top: 2px; font-size: 15px; color: rgba(13, 16, 24, .62); }
.mat__lock { font-size: 14px; color: var(--red-deep); }

/* Directório */
.dir__tools { display: grid; gap: 14px; margin-bottom: 20px; }
.search { position: relative; display: block; max-width: 520px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: rgba(13, 16, 24, .5); pointer-events: none; }
.search input { width: 100%; height: 46px; padding: 0 14px 0 42px; border: 0; border-radius: 2px; background: var(--white); box-shadow: inset 0 0 0 1px rgba(13, 16, 24, .14); font-size: 16px; }
.search input:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.person { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px 14px; align-items: start; background: var(--white); border-radius: 2px; padding: 18px; box-shadow: 0 0 0 1px rgba(13, 16, 24, .05); }
.person[hidden] { display: none; }
.person__txt h3 { font-size: 16px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; }
.person__txt p { font-size: 14px; color: rgba(13, 16, 24, .62); line-height: 1.4; margin-top: 2px; }
.person__where { display: flex; align-items: center; gap: 4px; }
.person__where svg { width: 14px; height: 14px; }
.person .app__btn { grid-column: 1 / -1; width: 100%; min-height: 38px; }
.empty { margin-top: 20px; font-size: 16px; color: rgba(13, 16, 24, .6); }

/* Perfil */
.profile { display: grid; gap: 18px; max-width: 720px; background: var(--white); border-radius: 2px; padding: 28px; box-shadow: 0 0 0 1px rgba(13, 16, 24, .05); }
.profile__id { display: flex; align-items: center; gap: 16px; }
.profile__id b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: -.02em; }
.profile__id span:not(.person__av) { font-size: 15px; color: rgba(13, 16, 24, .6); }
.profile__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile label:not(.switch) { display: grid; gap: 6px; font-size: 15px; }
.profile input[type="text"] { height: 46px; padding: 0 14px; border: 0; border-radius: 2px; background: var(--grey-1); font-size: 16px; }
.profile input[type="text"]:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.switch { display: flex; align-items: center; gap: 12px; font-size: 16px; cursor: pointer; }
.switch input { appearance: none; position: relative; width: 40px; height: 24px; flex: none; border-radius: 100px; background: rgba(13, 16, 24, .18); transition: background-color 200ms ease; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform 200ms var(--ease-out); }
.switch input:checked { background: var(--red); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.profile .app__btn { justify-self: start; }

/* Separadores (telemóvel) */
.tabs { display: none; }

/* Aviso */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80;
  padding: 12px 18px; border-radius: 2px; background: var(--ink); color: var(--white); font-size: 15px;
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity 200ms ease, transform 200ms var(--ease-out);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1023px) {
  .gate { grid-template-columns: 1fr; }
  .gate__art { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 32px var(--pad) calc(96px + env(safe-area-inset-bottom)); }
  .home { grid-template-columns: 1fr; }
  .home__side { position: static; }
  .people { grid-template-columns: 1fr 1fr; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); box-shadow: 0 -1px 0 rgba(13, 16, 24, .08);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .tabs .app__nav-btn { flex-direction: column; gap: 3px; padding: 6px 2px; font-size: 11px; color: rgba(13, 16, 24, .55); justify-content: center; }
  .tabs .app__nav-btn.is-on { color: var(--red); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .people { grid-template-columns: 1fr; }
  .profile__grid { grid-template-columns: 1fr; }
  .ev { grid-template-columns: 64px minmax(0, 1fr); }
  .ev > .app__btn, .ev > .ev__done { grid-column: 1 / -1; justify-self: stretch; }
  .mat { grid-template-columns: 44px minmax(0, 1fr); }
  .mat > .app__btn, .mat > .mat__lock { grid-column: 2; justify-self: start; }
  .profile { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .view.is-on { animation: none; }
}
