/* =========================================================
   Orion — estilos da tela de login
   ========================================================= */

:root {
  --green: #16a34a;
  --green-bright: #22c55e;
  --green-dark: #0f8a41;
  --green-rgb: 22, 163, 74;
  --green-soft: #f0fdf4;
  --green-line: #bbf7d0;
  --green-ink: #15803d;
  --ink: #111827;
  --ink-2: #1f2937;
  --text: #374151;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: #e5e7eb;
  --line-soft: #eceef1;
  --danger: #b91c1c;
  --radius-field: 14px;
  --radius-card: 22px;
  --shadow-card: 0 14px 40px rgba(17, 24, 39, 0.07);
  --shadow-btn: 0 10px 22px rgba(var(--green-rgb), 0.28);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

button, input { font-family: inherit; }

/* o atributo hidden nao esconde SVG por padrao no Chrome */
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------------- fundo decorativo ---------------- */

.decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.decor-leaf {
  position: absolute;
  top: -46px;
  left: -58px;
  width: 250px;
  height: 250px;
  opacity: .9;
}

.decor-shield {
  position: absolute;
  right: -132px;
  bottom: -132px;
  width: 300px;
  height: 338px;
  opacity: .6;
}

/* ---------------- layout ---------------- */

.page {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 560px);
  margin: 0 auto;
  padding: 44px 0 40px;
}

/* ---------------- marca ---------------- */

.brand { text-align: center; }

.logo {
  display: inline-flex;
  filter: drop-shadow(0 10px 22px rgba(var(--green-rgb), 0.25));
}

.wordmark {
  margin: 14px 0 0;
  font-size: clamp(36px, 10vw, 46px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.05;
}

.wordmark .ink { color: var(--ink); }
.wordmark .green { color: var(--green); }

.byline {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 500;
  color: var(--ink-2);
}

.tagline {
  margin: 22px 0 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}

.subtitle {
  margin: 8px 0 0;
  font-size: 15.5px;
  line-height: 1.5;
  color: #4b5563;
}

/* ---------------- cartão ---------------- */

.card {
  margin-top: 30px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 26px 22px 24px;
}

/* ---------------- campos ---------------- */

.field {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.field + .field { margin-top: 14px; }

.field:focus-within {
  border-color: var(--green-bright);
  box-shadow: 0 0 0 4px rgba(var(--green-rgb), 0.14);
}

.field.invalid {
  border-color: #fca5a5;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.field-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  flex: none;
}

.field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
}

.field input::placeholder { color: var(--muted-2); }

.ghost-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: -6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s ease;
}

.ghost-btn:hover { background: #f3f4f6; }

/* ---------------- linha: lembrar / esqueci ---------------- */

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 4px;
  flex-wrap: wrap;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.check .box {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2px solid #d1d5db;
  border-radius: 7px;
  background: #fff;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.check .box svg {
  opacity: 0;
  transform: scale(.5);
  transition: opacity .15s ease, transform .15s ease;
}

.check input:checked + .box {
  background: var(--green);
  border-color: var(--green);
}

.check input:checked + .box svg { opacity: 1; transform: scale(1); }

.check input:focus-visible + .box {
  box-shadow: 0 0 0 4px rgba(var(--green-rgb), 0.25);
}

.link {
  color: var(--green);
  font-weight: 600;
  font-size: 15.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link:hover { color: var(--green-dark); }

/* ---------------- alertas ---------------- */

.alert {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
}

.alert.success {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green-ink);
}

.alert[hidden] { display: none; }

/* ---------------- botões ---------------- */

.btn-primary {
  position: relative;
  width: 100%;
  height: 58px;
  margin-top: 16px;
  border: 0;
  border-radius: var(--radius-field);
  background: linear-gradient(135deg, var(--green-bright) 0%, var(--green) 52%, var(--green-dark) 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-btn);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

.btn-primary .btn-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-primary:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  cursor: not-allowed;
  filter: saturate(.75) brightness(.97);
  transform: none;
  box-shadow: none;
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(var(--green-rgb), .3), var(--shadow-btn);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.spinner[hidden] { display: none; }

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

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 15px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.btn-outline {
  width: 100%;
  min-height: 56px;
  padding: 8px 14px;
  border: 1.5px solid var(--green);
  border-radius: var(--radius-field);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .14s ease;
}

.btn-outline:hover {
  background: #f4fdf7;
  box-shadow: 0 6px 16px rgba(var(--green-rgb), .14);
  transform: translateY(-1px);
}

.btn-outline:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(var(--green-rgb), .25);
}

.alt {
  margin: 20px 0 0;
  text-align: center;
  font-size: 15.5px;
  color: var(--text);
}

/* ---------------- benefícios ---------------- */

.features {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 34px;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 4px 6px;
  text-align: center;
  color: var(--green);
}

.feature + .feature { border-left: 1px solid var(--line); }

.feature span {
  font-size: clamp(11.5px, 3vw, 13.5px);
  line-height: 1.35;
  color: #4b5563;
}

/* ---------------- rodapé ---------------- */

.footer {
  margin-top: 34px;
  text-align: center;
}

.foot-brand {
  margin: 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--green);
}

.slogan {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.foot-links {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 8px 18px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--muted);
}

.foot-links a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}

.foot-links a:hover { text-decoration: underline; }

/* ---------------- modais ---------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] { display: none; }

.modal .backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, .48);
  backdrop-filter: blur(3px);
  animation: fade .18s ease;
}

.modal .panel {
  position: relative;
  width: min(100%, 420px);
  max-height: min(88vh, 720px);
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  padding: 26px 24px 24px;
  box-shadow: 0 24px 60px rgba(17, 24, 39, .28);
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.2);
}

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.modal .close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal .close:hover { background: #e5e7eb; color: var(--ink); }

.panel-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  margin-bottom: 14px;
}

.panel-icon.green {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green-line);
}

.modal h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.3px;
}

.panel-sub {
  margin: 6px 0 18px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
}

.lbl {
  display: block;
  margin: 14px 0 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.inp {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15.5px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.inp::placeholder { color: var(--muted-2); }

.inp:focus {
  border-color: var(--green-bright);
  box-shadow: 0 0 0 4px rgba(var(--green-rgb), .14);
}

.inp.mono { letter-spacing: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.inp.code {
  height: 58px;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 12px;
}

.hint {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--green-soft);
  border: 1px dashed var(--green-line);
  color: var(--green-ink);
  font-size: 13.5px;
  line-height: 1.45;
}

.hint[hidden] { display: none; }

.btn-text {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
}

.btn-text:hover { background: #f9fafb; color: var(--ink); }

/* ---------------- toast (iPhone-style) ---------------- */

.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px) scale(.98);
  z-index: 120;
  width: min(calc(100% - 24px), 420px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .82);
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .04);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, transform .28s cubic-bezier(.2,.9,.2,1);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

.toast::before {
  content: '';
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex: none;
  background: linear-gradient(135deg, #34d399, #16a34a);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}

.toast.toast-error::before {
  background: linear-gradient(135deg, #fb7185, #ef4444);
}

.toast .toast-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  background: linear-gradient(135deg, #34d399, #16a34a);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}

.toast.toast-error .toast-icon { background: linear-gradient(135deg, #fb7185, #ef4444); }
.toast .toast-body { min-width: 0; }
.toast .toast-title { display: block; font-size: 12px; font-weight: 800; color: #6b7280; margin-bottom: 2px; letter-spacing: .01em; }
.toast .toast-msg { display: block; font-size: 14px; font-weight: 600; color: #111827; word-break: break-word; }

.toast[hidden] { display: none !important; }

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

/* 5 benefícios: em telas estreitas vira uma grade 3 + 2, com divisor
   horizontal entre as linhas e sem borda à esquerda do 1º de cada linha */
@media (max-width: 560px) {
  .features {
    grid-template-columns: repeat(6, 1fr);
    row-gap: 16px;
  }
  .feature:nth-child(-n+3) { grid-column: span 2; }
  .feature:nth-child(n+4) {
    grid-column: span 3;
    border-top: 1px solid var(--line);
    padding-top: 16px;
  }
  .feature:nth-child(4) { border-left: none; }
}

@media (max-width: 420px) {
  .page { padding-top: 34px; }
  .card { padding: 22px 16px 20px; }
  .row { gap: 8px; }
  .feature { padding: 4px 3px; }
  .subtitle br { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
