/* =====================================================================
   SegurosNet — Flow & Auth-specific styles
   Layers on top of tokens.css. Mirrors the §8.1 NuGet components.
   ===================================================================== */

@import url("tokens.css");

* { box-sizing: border-box; }

/* ─────────────────────────────────────────────────────────────────────
   Device frame: a 390×844 phone, consistent across every screen.
   ─────────────────────────────────────────────────────────────────── */
.sn-app {
  width: 390px;
  height: 844px;
  background: var(--bg-app);
  font-family: var(--font-sans);
  color: var(--fg-default);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
.sn-app *::-webkit-scrollbar { display: none; }

/* iOS-style status bar (60px safe area, drawn) */
.sn-statusbar {
  position: absolute; top: 0; left: 0; right: 0; height: 44px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px 0; pointer-events: none;
  color: var(--seg-blue);
  font-size: 15px; font-weight: 600;
}
.sn-statusbar.on-dark { color: #fff; }
.sn-statusbar .icons { display: flex; gap: 6px; align-items: center; }
.sn-statusbar .signal, .sn-statusbar .battery {
  width: 16px; height: 10px; background: currentColor;
  -webkit-mask-position: center; mask-position: center;
}

/* ─────────────────────────────────────────────────────────────────────
   AuthShell — login/cadastro shell
   Hero 390×350 + logo + form area. Used by Signup, OTP, PasswordReset.
   ─────────────────────────────────────────────────────────────────── */
.sn-auth-hero {
  position: relative;
  height: 350px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0 0 35px 35px;
}
.sn-auth-hero .photo {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.sn-auth-hero .grad {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(9,15,39,0) 35%, var(--seg-blue) 100%);
}
.sn-auth-hero .logo-wrap {
  position: absolute; left: 0; right: 0; bottom: 28px;
  display: flex; justify-content: center;
}
.sn-auth-body {
  flex: 1;
  padding: 24px 30px 18px;
  display: flex; flex-direction: column;
  background: var(--bg-surface);
}

/* ─────────────────────────────────────────────────────────────────────
   FlowShell — consent flow shell
   TopBar (back + breadcrumb + title) → Progress → scroll body → sticky CTA
   ─────────────────────────────────────────────────────────────────── */
.sn-flow {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg-app);
  position: relative;
}
.sn-topbar {
  padding: 56px 18px 8px;
  background: var(--bg-app);
  flex-shrink: 0;
  position: relative;
}
.sn-topbar .crumb {
  font-size: 12px; color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.sn-topbar .crumb b { color: var(--seg-blue-80); font-weight: 600; }
.sn-topbar .title {
  font-size: 22px; line-height: 1.15; font-weight: 700; color: var(--fg-strong);
  margin: 0;
}
.sn-topbar .subtitle {
  font-size: 14px; color: var(--fg-secondary);
  margin: 4px 0 0; line-height: 1.4;
}
.sn-topbar .back-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--white); box-shadow: var(--shadow-card);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--seg-blue); border: 0; cursor: pointer; font-size: 18px;
  margin-bottom: 10px; line-height: 1;
}

/* Progress bar — 4 bullets (or N) horizontal */
.sn-progress {
  display: flex; align-items: center; gap: 0;
  padding: 12px 22px 4px;
  flex-shrink: 0;
}
.sn-progress .step {
  flex: 1;
  display: flex; align-items: center;
  gap: 0;
  font-size: 10px; color: var(--fg-muted);
}
.sn-progress .dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gray-10);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-50); font-weight: 700; font-size: 10px;
  flex-shrink: 0;
  border: 2px solid transparent;
}
.sn-progress .step.done .dot {
  background: var(--seg-green); color: var(--seg-blue);
}
.sn-progress .step.current .dot {
  background: var(--seg-blue); color: var(--white);
  box-shadow: 0 0 0 4px var(--seg-blue-50);
}
.sn-progress .step.current .dot::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--white);
}
.sn-progress .step.current .dot > * { display: none; }
.sn-progress .bar {
  flex: 1; height: 2px;
  background: var(--gray-10);
  border-radius: 2px;
}
.sn-progress .step.done + .step .bar,
.sn-progress .step.current ~ .step .bar { background: var(--gray-10); }
.sn-progress .step.done .bar { background: var(--seg-green); }

.sn-progress-labels {
  display: flex; padding: 0 14px; gap: 0;
  font-size: 10px; color: var(--fg-muted); margin-top: 2px;
  flex-shrink: 0;
}
.sn-progress-labels .lab {
  flex: 1; text-align: center; padding: 0 2px;
  line-height: 1.1;
}
.sn-progress-labels .lab.on { color: var(--seg-blue); font-weight: 600; }

.sn-flow-body {
  flex: 1; padding: 16px 18px 110px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}

/* Sticky bottom CTA area + gradient overlay */
.sn-sticky-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 30px 20px 22px;
  background: linear-gradient(to bottom, rgba(242,242,255,0) 0%, var(--bg-app) 38%);
  pointer-events: none;
}
.sn-sticky-bottom > * { pointer-events: auto; }

/* ─────────────────────────────────────────────────────────────────────
   Buttons — primary, secondary, ghost, opin
   ─────────────────────────────────────────────────────────────────── */
.sn-btn {
  width: 100%;
  height: 48px; border-radius: 24px;
  background: var(--seg-green); color: var(--seg-blue);
  font-family: inherit;
  font-size: 15px; font-weight: 600;
  border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--shadow-card);
  transition: transform 120ms ease, filter 120ms ease;
}
.sn-btn:hover { filter: brightness(0.97); }
.sn-btn:active { transform: scale(0.99); }
.sn-btn.opin {
  height: 60px;
  border-radius: 30px;
}
.sn-btn-secondary {
  width: 100%;
  height: 44px; border-radius: 22px;
  background: transparent; color: var(--seg-blue);
  font-size: 14px; font-weight: 600; border: 0; cursor: pointer;
  font-family: inherit;
}
.sn-btn-ghost {
  height: 36px; padding: 0 22px;
  border-radius: 18px;
  background: var(--gray-10); color: var(--seg-blue-80);
  font-size: 13px; border: 0; cursor: pointer;
  font-family: inherit;
}
.sn-btn-icon-circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--white); box-shadow: var(--shadow-card);
  border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--seg-blue);
}

/* ─────────────────────────────────────────────────────────────────────
   Inputs (TextField)
   ─────────────────────────────────────────────────────────────────── */
.sn-field {
  display: flex; flex-direction: column; gap: 4px;
}
.sn-field-label {
  font-size: 12px; color: var(--link);
  font-weight: 500;
}
.sn-field-input {
  height: 44px; padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; color: var(--fg-strong);
  border: 1.5px solid transparent;
  transition: border-color 150ms ease, background 150ms ease;
}
.sn-field-input:focus-within {
  border-color: var(--seg-blue);
  background: var(--white);
}
.sn-field-input .ico {
  width: 16px; height: 16px;
  flex-shrink: 0;
  background: var(--fg-muted);
}
.sn-field-input input {
  border: 0; background: transparent; outline: none;
  font: inherit; color: inherit; flex: 1; min-width: 0;
}
.sn-field-input input::placeholder { color: var(--fg-muted); font-weight: 300; }
.sn-field.err .sn-field-input { border-color: var(--error); }
.sn-field-error {
  font-size: 12px; color: var(--error);
  display: flex; align-items: center; gap: 4px;
}
.sn-field.locked .sn-field-input {
  background: var(--seg-green-60);
  color: var(--seg-blue);
}
.sn-field-locked-hint {
  font-size: 11px; color: var(--success-dark);
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 2px;
}
.sn-field-locked-hint a {
  color: var(--link); cursor: pointer; font-weight: 600;
}

/* OTP code (6 boxes) */
.sn-otp {
  display: flex; gap: 10px; justify-content: center;
  margin: 18px 0;
}
.sn-otp .box {
  width: 44px; height: 56px;
  border-radius: 12px; background: var(--bg-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: var(--seg-blue);
  border: 1.5px solid transparent;
}
.sn-otp .box.filled { border-color: var(--seg-green); background: var(--white); }
.sn-otp .box.error  { border-color: var(--error); background: var(--error-bg); }
.sn-otp .box.focus  { border-color: var(--seg-blue); background: var(--white); animation: cur 1s steps(2) infinite; }
@keyframes cur { 50% { box-shadow: inset 0 0 0 1px var(--seg-blue); } }

/* Switch toggle */
.sn-switch {
  width: 40px; height: 20px; border-radius: 10px;
  background: var(--gray-30); position: relative;
  cursor: pointer; flex-shrink: 0;
  transition: background 180ms ease;
}
.sn-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: left 180ms ease;
}
.sn-switch.on { background: var(--seg-green); }
.sn-switch.on::after { left: 22px; }
.sn-switch.disabled { opacity: 0.4; cursor: not-allowed; }

/* Checkbox */
.sn-check {
  width: 18px; height: 18px; border-radius: 4px;
  border: 1.5px solid var(--gray-40);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; background: var(--white);
}
.sn-check.on { background: var(--seg-green); border-color: var(--seg-green); }
.sn-check.on::after {
  content: "✓"; color: var(--seg-blue); font-weight: 700; font-size: 13px; line-height: 1;
}

/* Radio */
.sn-radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--gray-40); flex-shrink: 0; background: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
}
.sn-radio.on { border-color: var(--seg-blue); }
.sn-radio.on::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--seg-blue);
}

/* ─────────────────────────────────────────────────────────────────────
   Tag / Chip
   ─────────────────────────────────────────────────────────────────── */
.sn-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 9999px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.02em; text-transform: uppercase;
  background: var(--seg-green); color: var(--seg-blue);
}
.sn-tag.alert { background: var(--alert-light); color: var(--alert); }
.sn-tag.info  { background: var(--info-light); color: var(--info-dark); }
.sn-tag.muted { background: var(--gray-10); color: var(--seg-blue-80); }
.sn-tag.outline {
  background: transparent; border: 1px solid var(--seg-green);
  color: var(--seg-blue-90);
}

/* ─────────────────────────────────────────────────────────────────────
   Cards
   ─────────────────────────────────────────────────────────────────── */
.sn-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 14px;
}
.sn-card.flat { box-shadow: none; border: 1px solid var(--border-soft); }

/* RadioCardRecomendado — two-option chooser */
.sn-radio-card {
  background: var(--bg-surface);
  border-radius: 18px;
  border: 1.5px solid var(--border-soft);
  padding: 16px;
  cursor: pointer;
  display: flex; gap: 12px;
  position: relative;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.sn-radio-card:hover { border-color: var(--seg-blue-70); }
.sn-radio-card.on {
  border-color: var(--seg-blue);
  box-shadow: 0 0 0 4px var(--seg-blue-50);
}
.sn-radio-card .sn-radio { margin-top: 2px; }
.sn-radio-card .title {
  font-size: 15px; font-weight: 700; color: var(--seg-blue);
  display: flex; align-items: center; gap: 8px;
}
.sn-radio-card .desc {
  font-size: 12px; color: var(--fg-secondary); margin-top: 4px; line-height: 1.4;
}
.sn-radio-card .badge-tag {
  position: absolute; top: -8px; right: 16px;
}

/* CardSociedadeParticipante */
.sn-card-soc {
  background: var(--bg-surface);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-card);
  min-height: 78px;
}
.sn-card-soc .disc {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.sn-card-soc .disc img { width: 34px; height: 34px; object-fit: contain; }
.sn-card-soc .meta { flex: 1; min-width: 0; }
.sn-card-soc .name {
  font-size: 14px; font-weight: 700; color: var(--seg-blue);
  line-height: 1.2;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.sn-card-soc .sub {
  font-size: 11px; color: var(--fg-muted);
  margin-top: 2px;
}
.sn-card-soc .group-link {
  font-size: 11px; color: var(--link); cursor: pointer; font-weight: 600;
  margin-top: 4px; display: inline-flex; align-items: center; gap: 4px;
}

/* Card Requerente */
.sn-card-req {
  background: var(--seg-blue);
  border-radius: 20px;
  padding: 16px;
  color: var(--white);
  display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
}
.sn-card-req::before {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 140px; height: 140px;
  background: url(assets/brand/gota-green.svg) center/contain no-repeat;
  opacity: 0.18;
}
.sn-card-req .label {
  font-size: 10px; color: var(--seg-green); font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.sn-card-req .who {
  font-size: 16px; font-weight: 700; line-height: 1.25;
}
.sn-card-req .who small { font-weight: 400; opacity: 0.8; font-size: 12px; display: block; margin-top: 2px; }
.sn-card-req .logos {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 12px;
  background: rgba(255,255,255,0.10);
  font-size: 11px;
}
.sn-card-req .detail-link {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
  color: var(--seg-green); font-size: 12px; font-weight: 600;
  cursor: pointer;
}

/* ─────────────────────────────────────────────────────────────────────
   Modal (sheet) — bottom sheet with 35px top radius
   ─────────────────────────────────────────────────────────────────── */
.sn-sheet-scrim {
  position: absolute; inset: 0; background: rgba(8,12,33,0.55);
  z-index: 40; display: flex; align-items: flex-end; justify-content: center;
}
.sn-sheet {
  width: 100%; max-height: 86%;
  background: var(--bg-surface);
  border-radius: 35px 35px 0 0;
  padding: 22px 22px 24px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sn-sheet::before {
  content: ""; align-self: center; flex-shrink: 0;
  width: 44px; height: 4px; border-radius: 4px;
  background: var(--gray-20); margin-bottom: 14px;
}
.sn-sheet .sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.sn-sheet .sheet-title {
  font-size: 18px; font-weight: 700; color: var(--seg-blue);
}
.sn-sheet .sheet-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gray-10); color: var(--seg-blue);
  border: 0; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.sn-sheet .sheet-body {
  flex: 1; overflow-y: auto; margin-top: 14px;
  font-size: 13px; color: var(--fg-default); line-height: 1.5;
}
.sn-sheet .sheet-action { margin-top: 14px; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────────────────
   Notification bars (toast 390×70)
   ─────────────────────────────────────────────────────────────────── */
.sn-toast {
  position: absolute; top: 56px; left: 14px; right: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-pop);
  z-index: 35;
  background: var(--white);
}
.sn-toast.success { background: var(--success-bg); color: var(--success-dark); }
.sn-toast.error   { background: var(--error-bg); color: var(--error-dark); }
.sn-toast.info    { background: var(--info-light); color: var(--info-dark); }
.sn-toast .dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--white); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-weight: 700;
}

/* ─────────────────────────────────────────────────────────────────────
   Tab bar (bottom)
   ─────────────────────────────────────────────────────────────────── */
.sn-nav {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 70px; padding: 9px 28px 18px;
  border-radius: 35px 35px 0 0;
  background: var(--gray-10);
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 -4px 18px -10px rgba(19,31,82,0.25);
  z-index: 10;
}
.sn-nav .tab {
  flex: 1; height: 40px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  background: transparent; border: 0; cursor: pointer;
}
.sn-nav .tab .ico { width: 20px; height: 20px; background: var(--fg-default); }
.sn-nav .tab .label { font-size: 11px; font-weight: 300; color: var(--fg-default); line-height: 1; }
.sn-nav .tab.active .ico { background: var(--seg-blue); }
.sn-nav .tab.active .label { color: var(--seg-blue); font-weight: 700; }

/* ─────────────────────────────────────────────────────────────────────
   Carrossel cards (boas-vindas)
   ─────────────────────────────────────────────────────────────────── */
.sn-carousel-card {
  flex-shrink: 0; padding: 28px 28px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  height: 100%;
  justify-content: center;
}
.sn-carousel-illus {
  width: 220px; height: 220px;
  margin-bottom: 20px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.sn-carousel-illus .blob {
  position: absolute; inset: 0;
  border-radius: 50%; opacity: 0.5;
}
.sn-dots {
  display: flex; gap: 6px; justify-content: center;
  margin-top: 18px;
}
.sn-dots .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gray-30);
}
.sn-dots .dot.on { background: var(--seg-blue); width: 22px; border-radius: 4px; }

/* ─────────────────────────────────────────────────────────────────────
   Termo de Consentimento — typography
   ─────────────────────────────────────────────────────────────────── */
.sn-termo {
  background: var(--bg-surface);
  border-radius: 18px;
  padding: 18px 18px;
  box-shadow: var(--shadow-card);
  font-size: 12px; color: var(--fg-default); line-height: 1.55;
}
.sn-termo h2 {
  font-size: 14px; color: var(--seg-blue);
  font-weight: 800; letter-spacing: 0.03em;
  margin: 0 0 10px; text-align: center;
}
.sn-termo h3 {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--seg-blue-80); margin: 14px 0 4px;
}
.sn-termo .dyn {
  background: var(--seg-green-60); color: var(--seg-blue-100);
  padding: 0 4px; border-radius: 3px;
  font-weight: 600;
}
.sn-termo .clause {
  margin: 6px 0; padding-left: 14px; position: relative;
}
.sn-termo .clause::before {
  content: "•"; position: absolute; left: 0; color: var(--seg-green-100);
  font-weight: 700;
}

/* ─────────────────────────────────────────────────────────────────────
   Settings list (Admin/Portal — Visual Config & Features)
   ─────────────────────────────────────────────────────────────────── */
.sn-list-row {
  background: var(--bg-surface);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-card);
  font-size: 13px;
}
.sn-list-row .swatch {
  width: 30px; height: 30px; border-radius: 8px;
  flex-shrink: 0; border: 1px solid var(--border-soft);
}

/* Admin desktop layout */
.sn-admin {
  width: 1200px; height: 800px;
  display: flex; background: var(--bg-app);
  font-family: var(--font-sans);
  color: var(--fg-default);
  overflow: hidden;
  border-radius: 8px;
}
.sn-admin-side {
  width: 240px; flex-shrink: 0;
  background: var(--seg-blue);
  color: var(--white);
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.sn-admin-side .brand { padding: 4px 12px 18px; }
.sn-admin-side .nav-item {
  padding: 10px 14px; border-radius: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
}
.sn-admin-side .nav-item.on {
  background: rgba(255,255,255,0.10); color: var(--white);
  font-weight: 600;
}
.sn-admin-side .nav-item:hover { color: var(--white); }
.sn-admin-main {
  flex: 1; padding: 24px 32px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
}
.sn-admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
}
.sn-admin-topbar h1 {
  font-size: 24px; color: var(--seg-blue);
  font-weight: 700; margin: 0;
}
.sn-admin-card {
  background: var(--bg-surface); border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-card);
}
.sn-admin-card h2 {
  font-size: 16px; color: var(--seg-blue); font-weight: 700;
  margin: 0 0 4px;
}
.sn-admin-card p { font-size: 13px; color: var(--fg-secondary); margin: 0; }
.sn-admin-table {
  width: 100%; border-collapse: collapse;
}
.sn-admin-table th, .sn-admin-table td {
  padding: 12px 12px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border-soft);
}
.sn-admin-table th {
  color: var(--fg-muted); font-weight: 600; text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.04em;
}
.sn-admin-table td { color: var(--fg-default); }

/* Small helper colors */
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.text-alert   { color: var(--alert); }
.text-info    { color: var(--info-dark); }
.text-blue    { color: var(--seg-blue); }
.text-muted   { color: var(--fg-muted); }
