/* Login e cadastro: painel de marca à esquerda, formulário à direita. */

:root {
  color-scheme: light; /* sempre papel claro, independente do tema do app (theme.css) */
  --paper: #f5f0e6;
  --card: #fbf8f1;
  --ink: #1d1c19;
  --ink-soft: #55524a;
  --ink-faint: #8a8578;
  --rule: #d8d0bd;
  --green: #2c6b4a;
  --green-deep: #1f4f36;
  --green-light: #8fc9a6;
  --rust: #a8452c;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: block;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* ---------- painel de marca ---------- */

.auth-side {
  background: var(--ink);
  color: var(--paper);
  padding: 44px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  overflow: hidden;
}

.auth-side-logo img {
  display: block;
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1);
}

.auth-side-body h2 {
  font-size: clamp(2rem, 3.2vw, 2.9rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 13em;
  margin-bottom: 28px;
}
.auth-side-body h2 em { font-style: normal; color: var(--green-light); }

.auth-points { list-style: none; max-width: 28em; border-top: 1px solid #3a3832; }
.auth-points li {
  padding: 12px 0;
  border-bottom: 1px solid #3a3832;
  color: #cfcabb;
  font-size: 0.98rem;
}

.auth-side-art img {
  display: block;
  width: 118%;
  max-width: none;
  height: auto;
  margin: 0 0 -6% -6%;
}

/* ---------- formulário ---------- */

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
}

.auth-panel { width: 100%; max-width: 400px; }

.auth-logo-mobile { display: none; margin-bottom: 36px; }
.auth-logo-mobile img { display: block; height: 38px; width: auto; }

.auth-panel h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.auth-sub { color: var(--ink-soft); margin-bottom: 32px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 7px;
}
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.field-row a { font-size: 0.85rem; }
.field-hint { margin-top: 6px; font-size: 0.8rem; color: var(--ink-faint); }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder { color: var(--ink-faint); }
.field input:hover { border-color: #bdb39b; }
.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(44, 107, 74, 0.15);
}

.pw { position: relative; }
.pw input { padding-right: 76px !important; }
.pw-toggle {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: auto; margin: 0;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: none;
}
.pw-toggle:hover { color: var(--ink); background: var(--paper); transform: translateY(-50%); box-shadow: none; }

.error-message {
  min-height: 0;
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--rust);
}
.error-message:empty { display: none; }
.error-message.is-error-box { padding: 10px 12px; background: #f6e4de; border-radius: 6px; }

.auth-link { color: var(--green); font-weight: 600; text-underline-offset: 3px; }
.auth-link:hover { color: var(--green-deep); }
.auth-panel a { color: var(--green); text-underline-offset: 3px; }

/* botões */

.btn-main,
.btn-alt {
  display: block;
  width: 100%;
  margin: 0;
  padding: 14px 20px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-main {
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
}
.btn-main:hover { background: var(--green-deep); border-color: var(--green-deep); transform: none; box-shadow: none; }
.btn-main:disabled { opacity: 0.6; cursor: wait; }
.btn-alt {
  background: transparent;
  color: var(--ink) !important;
  border: 1.5px solid var(--ink);
  text-decoration: none !important;
}
.btn-alt:hover { background: var(--ink); color: var(--paper) !important; }
.btn-main:focus-visible, .btn-alt:focus-visible, .auth-panel a:focus-visible, .pw-toggle:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.or-separator {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.or-separator::before, .or-separator::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.google-btn-wrapper { display: flex; justify-content: center; max-width: 100%; overflow: hidden; }

.auth-switch {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.auth-switch .btn-alt { margin-top: 12px; }

/* termos */

.terms-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 20px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-soft);
  cursor: pointer;
}
.terms-label input {
  width: 17px; height: 17px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--green);
  cursor: pointer;
}

/* confirmação de e-mail */

.verify-status {
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.verify-status.is-loading { border: 3px solid var(--rule); border-top-color: var(--green); animation: verify-spin 0.9s linear infinite; }
.verify-status.is-success { background: #dcebe1; color: var(--green); }
.verify-status.is-error { background: #f6e4de; color: var(--rust); }
.verify-icon { font-size: 1.6rem; font-weight: 600; line-height: 1; }
.verify-status.is-success .verify-icon::before { content: "✓"; }
.verify-status.is-error .verify-icon::before { content: "!"; }

@keyframes verify-spin { to { transform: rotate(360deg); } }

.auth-panel a.btn-main { color: var(--paper); text-decoration: none; }

.auth-foot {
  margin-top: 36px;
  font-size: 0.8rem;
  color: var(--ink-faint);
  text-align: center;
}
.auth-foot a { color: var(--ink-faint) !important; }
.auth-foot a:hover { color: var(--ink) !important; }

/* ---------- responsivo ---------- */

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { justify-content: flex-start; padding: 40px 24px 32px; }
  .auth-logo-mobile { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .verify-status.is-loading { animation-duration: 3s; }
}
