/* ===========================================================================
   Auth design (SteadyFlight Logbook) — integração do Claude Design (screen_auth.jsx + lib.jsx)
   Tokens e layout split-screen reusados por login, cadastro, esqueci e redefinir senha.
   =========================================================================== */
:root {
  --af-primary: #9C0F24;
  --af-bg: #F0EEEB;
  --af-card: #ffffff;
  --af-ink: #111111;
  --af-ink2: #555555;
  --af-ink3: #999999;
  --af-ink4: #bbbbbb;
  --af-line: #e6e6e6;
  --af-line2: #f0f0f0;
  --af-green: #16a34a;
  --af-amber: #d97706;
  --af-red: #dc2626;
  --af-font: 'Space Grotesk', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }

/* garante que o atributo [hidden] esconda mesmo com .af-field{display:flex} */
[hidden] { display: none !important; }

/* ---- Toggle de senha (ícone de olho moderno dentro do input) ---- */
.password-input-wrap { position: relative; display: block; width: 100%; }
.password-input-wrap .af-input { padding-right: 44px; }
.password-toggle-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer; padding: 0;
  border-radius: 8px; color: #999; transition: color .15s, background .15s;
}
.password-toggle-btn:hover { color: var(--af-primary); background: rgba(156, 15, 36, 0.07); }
.password-toggle-btn svg { width: 18px; height: 18px; display: block; }

body.af-body {
  margin: 0;
  font-family: var(--af-font);
  color: var(--af-ink);
  background: var(--af-bg);
}

.af-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  background: var(--af-bg);
}

/* ---- Painel de marca (esquerda) ---- */
.af-brand {
  position: relative;
  overflow: hidden;
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(150deg, var(--af-primary), rgba(156, 15, 36, 0.82));
}
.af-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    radial-gradient(circle at 80% 10%, #fff 0, transparent 40%),
    radial-gradient(circle at 10% 90%, #fff 0, transparent 35%);
}
.af-brand > * { position: relative; }
.af-logo-box {
  background: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  align-self: flex-start;
}
.af-logo-box img { height: 34px; width: auto; display: block; }
.af-kicker {
  font-size: 13px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.af-headline {
  font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -0.5px;
  color: #fff; margin: 12px 0 0;
}
.af-sub-brand {
  font-size: 14.5px; line-height: 1.55; max-width: 380px; margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.85);
}
.af-copyright { font-size: 12px; color: rgba(255, 255, 255, 0.6); }

/* ---- Área do formulário (direita) ---- */
.af-form-area {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px; overflow-y: auto;
}
.af-form-box { width: 100%; max-width: 380px; }
.af-form-box.wide { max-width: 560px; }

.af-head { margin-bottom: 24px; }
.af-head h1 { font-size: 25px; font-weight: 700; letter-spacing: -0.5px; color: var(--af-ink); margin: 0; }
.af-head p { font-size: 13.5px; color: var(--af-ink3); margin: 6px 0 0; }

.af-fields { display: flex; flex-direction: column; gap: 14px; }

.af-field { display: flex; flex-direction: column; gap: 6px; }
.af-field label { font-size: 12.5px; font-weight: 600; color: var(--af-ink2); }
.af-field .af-hint { font-size: 11.5px; color: var(--af-ink4); font-weight: 500; }
.af-input {
  width: 100%; font-family: var(--af-font); font-size: 14px; color: var(--af-ink);
  background: #fff; border: 1.5px solid var(--af-line); border-radius: 10px;
  padding: 11px 13px; transition: border-color 0.15s, box-shadow 0.15s;
}
.af-input:focus {
  outline: none; border-color: var(--af-primary);
  box-shadow: 0 0 0 3px rgba(156, 15, 36, 0.12);
}

.af-btn {
  font-family: var(--af-font); font-weight: 700; font-size: 15px; cursor: pointer;
  border: none; border-radius: 11px; padding: 13px 18px; width: 100%;
  background: var(--af-primary); color: #fff;
  box-shadow: 0 2px 10px rgba(156, 15, 36, 0.3);
  transition: filter 0.15s, opacity 0.15s;
}
.af-btn:hover { filter: brightness(1.05); }
.af-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.af-row-end { display: flex; justify-content: flex-end; }
.af-linkbtn {
  background: none; border: none; cursor: pointer; font-family: var(--af-font);
  color: var(--af-primary); font-size: 12.5px; font-weight: 600; text-decoration: none;
}
.af-linkbtn:hover { text-decoration: underline; }

.af-divider {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid #e8e6e3;
  text-align: center; font-size: 13px; color: var(--af-ink3);
}
.af-divider a, .af-divider .af-strong {
  color: var(--af-primary); font-weight: 700; text-decoration: none;
}
.af-back { margin-top: 22px; text-align: center; }
.af-back a { color: var(--af-ink3); font-size: 13px; font-weight: 600; text-decoration: none; }

/* ---- Flash ---- */
.af-flash {
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
  font-size: 13px; line-height: 1.45; border: 1px solid transparent;
}
.af-flash strong { display: block; font-weight: 700; margin-bottom: 2px; }
.af-flash.error, .af-flash.danger { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.25); color: #991b1b; }
.af-flash.success { background: rgba(22, 163, 74, 0.08); border-color: rgba(22, 163, 74, 0.25); color: #166534; }
.af-flash.warning { background: rgba(217, 119, 6, 0.08); border-color: rgba(217, 119, 6, 0.25); color: #92400e; }
.af-flash.info { background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.22); color: #1e40af; }

/* ---- Cadastro (seções numeradas) ---- */
.af-card { background: #fff; border: 1px solid var(--af-line2); border-radius: 14px; padding: 26px 28px; }
.af-section { margin-bottom: 22px; }
.af-section-title { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.af-section-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: rgba(156, 15, 36, 0.1); color: var(--af-primary);
  font-size: 11.5px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.af-section-title span:last-child { font-size: 13.5px; font-weight: 700; letter-spacing: -0.2px; }
.af-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.af-grid-3 { display: grid; grid-template-columns: 100px 1fr 1fr; gap: 13px; }
.af-grid-cep { display: grid; grid-template-columns: 150px 1fr; gap: 13px; }
.af-grid-city { display: grid; grid-template-columns: 1fr 90px; gap: 13px; }

.af-radio { display: flex; gap: 10px; flex-wrap: wrap; }
.af-radio.cols-2 > * { flex: 1 1 0; min-width: 160px; }
.af-radio label {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  border: 1.5px solid var(--af-line); border-radius: 11px; padding: 12px 14px; flex: 1;
  transition: border-color 0.15s, background 0.15s;
}
.af-radio label:hover { border-color: rgba(156, 15, 36, 0.35); }
.af-radio input { margin-top: 3px; accent-color: var(--af-primary); }
.af-radio .rl-title { font-size: 13.5px; font-weight: 600; color: var(--af-ink); }
.af-radio .rl-sub { font-size: 12px; color: var(--af-ink3); margin-top: 2px; }

.af-check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--af-line2); }
.af-check input { margin-top: 3px; accent-color: var(--af-primary); }
.af-check .ck-title { font-size: 13px; color: var(--af-ink); }
.af-check .ck-sub { font-size: 12px; color: var(--af-ink3); margin-top: 2px; }

.af-err-text { font-size: 12px; color: var(--af-red); font-weight: 600; }

/* ---- Responsivo: empilha e some o painel de marca em telas pequenas ---- */
@media (max-width: 860px) {
  .af-wrap { grid-template-columns: 1fr; }
  .af-brand { padding: 28px 24px; min-height: auto; }
  .af-headline { font-size: 24px; }
  .af-sub-brand { display: none; }
  .af-copyright { display: none; }
}
