/* Eclésia · login. Mobile-first; desktop (>= 960px) segue a referência 1440 × 810. */
:root {
  --bg-deep: #1a0100;
  --wall: #2a0508;
  --card: rgba(49, 6, 2, .86);
  --card-edge: rgba(243, 214, 190, .22);
  --gold-1: #eec193;
  --gold-2: #d9a170;
  --gold-line: rgba(238, 193, 147, .55);
  --text: #f3e6dc;
  --text-muted: #c9aaa0;
  --line: rgba(243, 230, 220, .32);
  --radius-card: 19px;
  --radius-field: 7px;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font: 400 1rem/1.5 var(--sans);
  /* A base escurece para os textos sobre o piso iluminado manterem contraste. */
  background:
    linear-gradient(180deg, transparent 50%, rgba(24, 1, 0, .78) 82%, rgba(24, 1, 0, .92)),
    url('assets/fundo-mobile.webp') center top / cover no-repeat,
    var(--bg-deep);
}
img, svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout (mobile) ---------- */
.login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: max(28px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
}
.marca { display: contents; }
.marca__logo { order: 1; margin: 0; width: min(62vw, 260px); }
.painel { order: 2; }
.marca__fio { order: 3; }
.marca__chamada { order: 4; }
.recursos { order: 5; }

/* ---------- Marca ---------- */
.marca__logo img {
  width: 100%;
  height: auto;
  /* Logo original do usuário; o fundo vinho foi retirado por luminância (assets/logo-eclesia.webp). */
  filter: drop-shadow(0 6px 14px rgba(10, 0, 0, .45));
}
.marca__fio { display: block; width: 49px; height: 1px; background: var(--gold-line); }
.marca__chamada {
  margin: 0;
  max-width: 21ch;
  font: 500 1.375rem/1.2 var(--serif);
  letter-spacing: .02em;
  text-align: center;
}
.recursos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 0;
}
.recurso {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  font-size: .875rem;
  line-height: 1.3;
  text-align: center;
  color: var(--text);
}
.recurso + .recurso { border-left: 1px solid var(--gold-line); }
.recurso__icone {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-line);
  border-radius: 9px;
  background: rgba(26, 1, 0, .25);
}
.recurso__icone svg, .campo__icone, .campo__olho svg, .botao svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.recurso__icone svg { width: 28px; height: 28px; color: var(--text); }

/* ---------- Painel de login ---------- */
.painel {
  width: 100%;
  max-width: 433px;
  padding: 36px 24px 32px;
  border-radius: var(--radius-card);
  border: 1px solid var(--card-edge);
  background:
    linear-gradient(180deg, rgba(150, 70, 45, .28), transparent 38%),
    var(--card);
  box-shadow: 0 30px 80px rgba(10, 0, 0, .55), inset 0 1px 0 rgba(255, 230, 205, .12);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}
.painel__titulo { margin: 0; font: 500 2.375rem/1.1 var(--serif); letter-spacing: -.005em; }
.painel__sub {
  margin: 10px 0 28px;
  font: 400 .75rem/1 var(--sans);
  letter-spacing: .45em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form { display: flex; flex-direction: column; gap: 15px; }
.campo {
  position: relative;
  display: flex;
  align-items: center;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  background: rgba(26, 1, 0, .22);
  transition: border-color .2s, box-shadow .2s;
}
.campo:focus-within { border-color: var(--gold-1); box-shadow: 0 0 0 3px rgba(238, 193, 147, .18); }
.campo__icone { width: 20px; height: 20px; margin: 0 12px 0 18px; color: var(--text-muted); flex: none; }
.campo input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--text);
  font: 400 1rem var(--sans); /* 16px evita zoom automático no iOS */
  outline: none;
}
.campo input::placeholder { color: var(--text-muted); opacity: 1; }
.campo__olho {
  flex: none;
  width: 48px;
  height: 100%;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  border-radius: 0 var(--radius-field) var(--radius-field) 0;
}
.campo__olho svg { width: 21px; height: 21px; }
.campo__olho:focus-visible { outline: 2px solid var(--gold-1); outline-offset: -4px; }

.opcoes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: .875rem;
}
.lembrar { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.lembrar input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lembrar__caixa {
  width: 19px;
  height: 19px;
  border: 1px solid var(--line);
  border-radius: 3px;
  display: grid;
  place-items: center;
}
.lembrar input:checked + .lembrar__caixa { background: var(--gold-1); border-color: var(--gold-1); }
.lembrar input:checked + .lembrar__caixa::after {
  content: '';
  width: 5px;
  height: 10px;
  border: solid #3a0806;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
.lembrar input:focus-visible + .lembrar__caixa { outline: 2px solid var(--gold-1); outline-offset: 2px; }
.link { color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.link:hover, .link:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

.mensagem { margin: 0; min-height: 0; font-size: .875rem; color: #ffb4a2; }
.mensagem:empty { display: none; }
.mensagem.ok { color: var(--gold-1); }

.botao {
  width: 100%;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: var(--radius-field);
  font: 500 1.0625rem var(--sans);
  cursor: pointer;
  transition: filter .2s, transform .1s, background-color .2s;
}
.botao svg { width: 20px; height: 20px; }
.botao:active { transform: translateY(1px); }
.botao:focus-visible { outline: 2px solid var(--gold-1); outline-offset: 3px; }
.botao[disabled] { opacity: .6; cursor: progress; }
.botao--ouro {
  margin-top: 8px;
  border: 0;
  color: #3a0806;
  background: linear-gradient(90deg, var(--gold-1), #e3b585 55%, var(--gold-2));
  box-shadow: 0 8px 24px rgba(217, 161, 112, .25), inset 0 1px 0 rgba(255, 245, 230, .6);
}
.botao--ouro:hover { filter: brightness(1.06); }
.botao--contorno {
  height: 50px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}
.botao--contorno:hover { background: rgba(243, 230, 220, .06); }
.google { width: 22px; height: 22px; }

.ou {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px 0;
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ou::before, .ou::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Desktop: duas colunas como na referência ---------- */
@media (min-width: 960px) {
  body {
    /* Escurece a parede sob o texto para chegar ao tom da referência e garantir contraste. */
    background-image:
      linear-gradient(90deg, rgba(24, 1, 0, .55) 0%, rgba(24, 1, 0, .4) 38%, rgba(24, 1, 0, .1) 55%, transparent 70%),
      url('assets/fundo-desktop.webp');
    background-position: center;
    background-attachment: scroll;
  }
  .login {
    display: grid;
    grid-template-columns: minmax(0, 405px) minmax(0, 433px);
    justify-content: space-between;
    align-items: start;
    width: min(100% - 80px, 1023px);
    margin: 0 auto 0 calc(50% - 532px);
    padding: 78px 0 40px;
  }
  .marca { display: flex; flex-direction: column; align-items: flex-start; }
  .marca__logo { width: 446px; margin: 0 0 -8px -16px; }
  .marca__fio { margin: 26px 0 0 2px; }
  .marca__chamada { margin-top: 26px; max-width: none; font-size: 1.875rem; line-height: 1.12; letter-spacing: .035em; text-align: left; }
  /* As quebras da referência são de composição (a 1ª linha caberia mais palavras). */
  .marca__chamada span { display: block; }
  .recursos { margin-top: 30px; justify-content: flex-start; }
  .recurso { width: 157px; align-items: flex-start; text-align: left; padding: 0; font-size: .9375rem; }
  .recurso + .recurso { border-left: 0; position: relative; }
  .recurso + .recurso::before {
    content: '';
    position: absolute;
    left: -50px;
    top: 15px;
    height: 34px;
    border-left: 1px solid var(--gold-line);
  }
  .recurso__icone { width: 57px; height: 57px; }
  .painel { margin-top: 72px; padding: 52px 56px 40px 60px; }
  .opcoes { margin-top: 0; }
  .botao--ouro { margin-top: 2px; }
  .ou { margin: 14px 0; }
  .painel__titulo { font-size: 2.95rem; }
  .painel__sub { font-size: .8125rem; letter-spacing: .5em; }
  .campo { height: 49px; }
}
@media (min-width: 960px) and (max-width: 1120px) {
  .login { margin: 0 auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .marca__logo, .marca__fio, .marca__chamada, .recursos, .painel { animation: surgir .9s cubic-bezier(.2, .7, .2, 1) both; }
  .painel { animation-delay: .15s; }
  .marca__chamada { animation-delay: .25s; }
  .recursos { animation-delay: .35s; }
}
@keyframes surgir { from { opacity: 0; transform: translateY(14px); } }
