/* Entrada, cadastro e primeiro acesso — experiência adaptativa v4. */
:root {
  --access-bg: #0c0712;
  --access-surface: #17101f;
  --access-raised: #21152d;
  --access-selected: #2d1741;
  --access-border: #49365a;
  --access-text: #f7f2fb;
  --access-muted: #b7a9c2;
  --access-gold: #f0c833;
  --access-purple: #7c2db5;
  --access-green: #42d6a4;
}

.acc-entry,
.aob {
  position: fixed;
  inset: 0;
  z-index: 100080;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(7 4 10 / 88%);
  color: var(--access-text);
  backdrop-filter: blur(14px);
}

.acc-entry.hidden,
.aob.hidden { display: none !important; }

.acc-dialog {
  display: grid;
  grid-template-columns: minmax(320px, .78fr) minmax(560px, 1.22fr);
  width: min(1180px, 100%);
  height: min(820px, calc(100dvh - 48px));
  overflow: hidden;
  border: 1px solid var(--access-border);
  border-radius: 28px;
  background: var(--access-bg);
  box-shadow: 0 32px 100px rgb(0 0 0 / 58%);
}

.acc-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(32px, 4vw, 58px);
  overflow: hidden;
  background:
    radial-gradient(circle at 110% 18%, rgb(124 45 181 / 36%), transparent 42%),
    linear-gradient(160deg, #2a1038, #1b0c25 70%);
}

.acc-story::after {
  content: "";
  position: absolute;
  right: -8rem;
  bottom: 12%;
  width: 22rem;
  aspect-ratio: 1;
  border: 1px solid rgb(240 200 51 / 18%);
  border-radius: 50%;
  pointer-events: none;
}

.acc-brand { color: var(--access-gold); font: 800 .8rem/1 Poppins, Inter, sans-serif; letter-spacing: .08em; }
.acc-story-copy { position: relative; z-index: 1; }
.acc-story-kicker { margin-bottom: 16px; color: var(--access-green); font-size: .7rem; font-weight: 900; letter-spacing: .08em; }
.acc-story h2 { max-width: 520px; margin: 0; font: 800 clamp(2rem, 3.1vw, 3.4rem)/1.08 Poppins, Inter, sans-serif; }
.acc-story p { max-width: 480px; margin: 18px 0 0; color: var(--access-muted); font-size: .93rem; line-height: 1.6; }
.acc-story-foot { color: var(--access-muted); font-size: .7rem; }

.acc-workspace {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: clamp(28px, 4.5vw, 64px);
}

.acc-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.acc-head h2 { margin: 0; color: var(--access-text); font: 800 clamp(1.45rem, 2.4vw, 2rem)/1.18 Poppins, Inter, sans-serif; }
.acc-head p { margin: 7px 0 0; color: var(--access-muted); font-size: .82rem; }
.acc-close {
  width: 44px;
  height: 44px;
  margin-left: auto;
  flex: 0 0 auto;
  border: 1px solid var(--access-border);
  border-radius: 14px;
  color: var(--access-muted);
  font-size: 1.45rem;
  line-height: 1;
}
.acc-close:hover,
.acc-close:focus-visible { border-color: var(--access-gold); color: var(--access-text); }

.acc-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.acc-tabs::-webkit-scrollbar { display: none; }
.acc-tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
  border: 1px solid var(--access-border);
  border-radius: 999px;
  color: var(--access-muted);
  font-size: .72rem;
  font-weight: 800;
}
.acc-tab.active { border-color: var(--access-gold); background: rgb(240 200 51 / 10%); color: var(--access-gold); }
.acc-body { min-width: 0; }

.acc-grid,
.acc-plan-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.acc-card,
.acc-plan {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--access-border);
  border-radius: 18px;
  background: var(--access-raised);
}
.acc-card { display: flex; min-height: 210px; flex-direction: column; }
.acc-card.featured { border-color: var(--access-gold); }
.acc-card h3,
.acc-plan b { margin: 12px 0 0; color: var(--access-text); font: 800 .98rem/1.25 Poppins, Inter, sans-serif; }
.acc-card p { margin: 8px 0 0; color: var(--access-muted); font-size: .76rem; line-height: 1.55; }
.acc-card button,
.acc-submit {
  min-height: 44px;
  margin-top: auto;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--access-purple);
  color: #fff;
  font-size: .77rem;
  font-weight: 900;
}
.acc-card.featured button,
.acc-submit.gold { background: var(--access-gold); color: #241a00; }

.acc-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.acc-field.full,
.acc-note,
.acc-check,
.acc-status,
.acc-actions { grid-column: 1 / -1; }
.acc-field label { display: block; margin-bottom: 7px; color: var(--access-muted); font-size: .64rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.acc-field input,
.acc-field textarea,
.acc-field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--access-border);
  border-radius: 13px;
  outline: 0;
  background: #110a18;
  color: var(--access-text);
  font-size: .86rem;
}
.acc-field textarea { min-height: 104px; resize: vertical; }
.acc-field input:focus,
.acc-field textarea:focus,
.acc-field select:focus { border-color: var(--access-gold); box-shadow: 0 0 0 3px rgb(240 200 51 / 12%); }
.acc-check { display: flex; align-items: flex-start; gap: 10px; color: var(--access-muted); font-size: .76rem; line-height: 1.5; }
.acc-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--access-gold); }
.acc-note { padding: 13px 15px; border-left: 3px solid var(--access-green); border-radius: 10px; background: rgb(66 214 164 / 8%); color: #c7f7e6; font-size: .77rem; line-height: 1.5; }
.acc-status { min-height: 20px; color: var(--access-gold); font-size: .78rem; }
.acc-actions { display: flex; justify-content: flex-end; gap: 10px; }
.acc-actions .acc-submit { width: auto; min-width: 190px; margin: 0; }
.acc-secondary { min-height: 44px; padding: 10px 14px; border: 1px solid var(--access-border); border-radius: 12px; color: var(--access-text); font-size: .76rem; font-weight: 800; }
.acc-shortcut { margin-top: 18px; }
.acc-plan ul { margin: 12px 0 0 18px; color: var(--access-muted); font-size: .76rem; line-height: 1.5; list-style: disc; }
.acc-badge { display: inline-flex; margin-top: 10px; padding: 4px 8px; border: 1px solid var(--access-border); border-radius: 999px; font-size: .64rem; }
.acc-badge.ok { border-color: #176348; color: #6ee7b7; }
.acc-badge.wait { border-color: #8b671a; color: #f8dc68; }

.aob-card {
  width: min(760px, 100%);
  max-height: min(820px, calc(100dvh - 48px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--access-border);
  border-radius: 24px;
  background: var(--access-bg);
  box-shadow: 0 28px 100px rgb(0 0 0 / 58%);
}
.aob-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.aob-step { color: var(--access-gold); font-size: .66rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.aob-later { min-height: 40px; color: var(--access-muted); font-size: .74rem; font-weight: 800; }
.aob h2 { margin: 22px 0 0; color: var(--access-text); font: 800 clamp(1.6rem, 3vw, 2.25rem)/1.16 Poppins, Inter, sans-serif; }
.aob p { margin: 8px 0 0; color: var(--access-muted); font-size: .84rem; line-height: 1.55; }
.aob-progress { height: 6px; margin: 18px 0 24px; overflow: hidden; border-radius: 99px; background: #2b2132; }
.aob-progress span { display: block; height: 100%; border-radius: inherit; background: var(--access-gold); }
.aob-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.aob-choice { display: flex; min-height: 82px; align-items: flex-start; gap: 11px; padding: 14px; border: 1px solid var(--access-border); border-radius: 15px; background: var(--access-surface); cursor: pointer; }
.aob-choice:has(input:checked) { border-color: var(--access-gold); background: var(--access-selected); }
.aob-choice input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--access-gold); }
.aob-choice b { display: block; color: var(--access-text); font-size: .82rem; }
.aob-choice small { display: block; margin-top: 4px; color: var(--access-muted); font-size: .7rem; line-height: 1.35; }
.aob-field { margin-top: 16px; }
.aob-field label { display: block; margin-bottom: 7px; color: var(--access-muted); font-size: .65rem; font-weight: 900; text-transform: uppercase; }
.aob-field select,
.aob-field input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--access-border); border-radius: 13px; background: #110a18; color: var(--access-text); }
.aob-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.aob-btn { min-height: 44px; padding: 10px 15px; border: 1px solid var(--access-border); border-radius: 12px; color: var(--access-text); font-size: .77rem; font-weight: 900; }
.aob-btn.primary { min-width: 190px; border: 0; background: var(--access-gold); color: #241a00; }
.aob-status { min-height: 18px; margin-top: 10px; color: var(--access-gold); font-size: .76rem; }

body.theme-light {
  --access-bg: #fbf9fc;
  --access-surface: #fff;
  --access-raised: #f4eef7;
  --access-selected: #f0e4f7;
  --access-border: #d9cbe1;
  --access-text: #24182d;
  --access-muted: #6e6177;
}
body.theme-light .acc-entry,
body.theme-light .aob { background: rgb(47 35 54 / 42%); }
body.theme-light .acc-story { background: linear-gradient(160deg, #f5e8fa, #ead9f1); }
body.theme-light .acc-field input,
body.theme-light .acc-field textarea,
body.theme-light .acc-field select,
body.theme-light .aob-field input,
body.theme-light .aob-field select { background: #fff !important; color: var(--access-text) !important; }

@media (max-width: 900px) {
  .acc-entry,
  .aob { padding: 0; place-items: stretch; }
  .acc-dialog { display: block; width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .acc-story { display: none; }
  .acc-workspace { height: 100%; padding: 24px 18px 32px; }
  .acc-head { position: sticky; top: -24px; z-index: 3; margin: -24px -18px 18px; padding: 22px 18px 14px; background: rgb(12 7 18 / 94%); backdrop-filter: blur(12px); }
  body.theme-light .acc-head { background: rgb(251 249 252 / 94%); }
  .acc-grid,
  .acc-plan-row { grid-template-columns: 1fr; }
  .acc-card { min-height: 148px; }
  .acc-form { grid-template-columns: 1fr; }
  .acc-field.full,
  .acc-note,
  .acc-check,
  .acc-status,
  .acc-actions { grid-column: 1; }
  .acc-actions { position: sticky; bottom: -32px; z-index: 2; margin: 6px -18px -32px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--access-bg) 20%); }
  .acc-actions .acc-submit { flex: 1; min-width: 0; }
  .aob-card { width: 100%; max-height: 100dvh; min-height: 100dvh; padding: 24px 18px calc(28px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; }
  .aob-options { grid-template-columns: 1fr; }
  .aob-actions { position: sticky; bottom: 0; margin-right: -18px; margin-bottom: calc(-28px - env(safe-area-inset-bottom)); margin-left: -18px; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--access-bg) 20%); }
  .aob-btn.primary { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .acc-entry *, .aob * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
