:root {
  --bg: #10100f;
  --panel: rgba(26, 24, 21, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.04);
  --text: #fff7e8;
  --muted: #d9ccb7;
  --accent: #ffd07f;
  --accent-strong: #ff9357;
  --success: #b2f3bf;
  --danger: #ff9a9a;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 28px 84px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "SUIT Variable", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 175, 99, 0.22), transparent 28%),
    radial-gradient(circle at right bottom, rgba(255, 120, 80, 0.2), transparent 24%),
    linear-gradient(160deg, #16120f 0%, #201712 48%, #281a15 100%);
}

.app-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px;
}

.topbar,
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar,
.card {
  border-radius: 24px;
}

.topbar {
  padding: 20px;
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.layout {
  display: grid;
  gap: 16px;
}

.card {
  width: 100%;
  padding: 20px;
}

.card-hero {
  display: grid;
  gap: 14px;
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #2b1606;
  font-size: 1.3rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  line-height: 1.05;
}

.topbar-copy,
.hero-copy {
  font-size: 1rem;
  color: var(--muted);
  max-width: 48rem;
}

.topbar-actions,
.hero-stats,
.intro-points,
.stage-list,
.result-grid {
  display: grid;
  gap: 12px;
}

.topbar-actions {
  grid-template-columns: 1fr 1fr;
}

.notice-box,
.hero-stats div,
.intro-points div,
.status-block,
.result-card,
.error-panel {
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.result-card {
  min-height: 130px;
}

.intro-points div {
  color: var(--muted);
}

.section-kicker {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.muted,
.status-message,
.field-error,
.summary-box,
#result-summary,
#current-state-output,
#personality-output,
#problem-output,
#cause-output,
#solution-output,
#action-output,
#caution-output,
#conclusion-output {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.card-header,
.status-header,
.action-row,
.result-panel-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.auth-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
}

.auth-panel-head,
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.login-state {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.login-state.authenticated {
  color: #06240f;
  background: linear-gradient(135deg, #9cf2c4, #56d18a);
}

.auth-grid {
  display: grid;
  gap: 14px;
}

.auth-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.history-panel {
  display: grid;
  gap: 12px;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.history-list li {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.9rem;
}

.history-list button {
  margin-top: 8px;
  width: 100%;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field-grid {
  display: grid;
  gap: 16px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 8px;
}

label span {
  font-size: 0.95rem;
  color: var(--text);
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.choice-group {
  display: grid;
  gap: 8px;
}

.inline-choice {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-choice label,
.checkbox-field {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
}

.checkbox-field {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

input,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  min-height: 48px;
  font-size: 18px;
  font-weight: 600;
  input,
select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    padding: 14px 16px;
    outline: none;
    min-height: 48px;
    font-size: 18px;
    font-weight: 600;
}select option {
    background: #2b2b2b;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
}

select option:hover {
    background: #f5a623;
    color: #111111;
}

select option:checked {
    background: #f5a623;
    color: #111111;
}
}

input:focus,
select:focus {
  border-color: rgba(255, 196, 128, 0.85);
  box-shadow: 0 0 0 3px rgba(255, 182, 120, 0.16);
}

textarea {
  min-height: 124px;
  resize: vertical;
  font: inherit;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 14px 16px;
}

textarea:focus {
  outline: none;
  border-color: rgba(255, 196, 128, 0.85);
  box-shadow: 0 0 0 3px rgba(255, 182, 120, 0.16);
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  font-size: 1rem;
}

.primary-btn {
  color: #35180b;
  background: linear-gradient(135deg, #ffd58f, #ff9b67);
}

.secondary-btn,
.ghost-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

.action-row {
  justify-content: stretch;
  flex-wrap: wrap;
}

.action-row > * {
  flex: 1 1 180px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  margin: 16px 0 10px;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: inherit;
  transition: width 0.35s ease;
}

.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.08);
}

.stage-list {
  grid-template-columns: 1fr;
  margin: 14px 0 0;
  padding-left: 20px;
}

.stage-list li {
  min-height: 40px;
  display: flex;
  align-items: center;
  color: var(--muted);
}

.stage-list li::marker {
  color: rgba(255, 198, 139, 0.9);
}

.stage-list li.active {
  color: var(--text);
  font-weight: 700;
}

.stage-list li.done {
  color: var(--success);
}

.status-pill.running {
  color: #35180b;
  background: linear-gradient(135deg, #ffd58f, #ff9b67);
}

.status-pill.done {
  color: #072013;
  background: linear-gradient(135deg, #8ef0b2, #46ce7d);
}

.status-pill.error {
  color: #2a0a0a;
  background: linear-gradient(135deg, #ffb0b0, #ff7d7d);
}

.error-banner,
.error-panel {
  border-color: rgba(255, 154, 154, 0.35);
}

.error-banner,
.error-panel,
.field-error {
  color: #ffd2d2;
}

.field-error:empty {
  display: none;
}

.field-error {
  min-height: 1.1em;
}

.input-invalid {
  border-color: rgba(255, 154, 154, 0.85) !important;
  box-shadow: 0 0 0 3px rgba(255, 154, 154, 0.12);
}

.result-panel {
  display: grid;
  gap: 16px;
}

.result-summary,
.summary-box,
#result-summary,
.result-card p {
  white-space: pre-wrap;
  word-break: keep-all;
  line-height: 1.65;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

#free-result-group .result-card {
  border-color: rgba(255, 194, 122, 0.34);
}

#premium-result-group .result-card {
  border-color: rgba(178, 243, 191, 0.35);
}

.result-card-wide {
  grid-column: 1 / -1;
}

.compact {
  justify-content: flex-start;
}

.error-panel.server {
  border-color: rgba(255, 190, 120, 0.45);
}

.error-panel.pdf {
  border-color: rgba(255, 154, 154, 0.45);
}

.error-panel.analysis {
  border-color: rgba(173, 193, 255, 0.45);
}

@media (max-width: 1080px) {
  .topbar-actions,
  .two-col,
  .stage-list,
  .result-grid,
  .auth-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding: 10px;
  }

  .topbar,
  .card {
    padding: 14px;
    border-radius: 18px;
  }

  h1 {
    font-size: clamp(1.4rem, 9vw, 2rem);
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  input,
  select,
  textarea {
    font-size: 0.95rem;
  }
}

@media (min-width: 900px) {
  .app-shell {
    padding: 24px;
  }

  .topbar,
  .card {
    border-radius: 28px;
    padding: 24px;
  }

  .layout {
    grid-template-columns: 1fr 1.15fr;
    align-items: start;
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-actions {
    grid-template-columns: repeat(2, minmax(0, 220px));
    justify-content: start;
  }

  .stage-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stack-mobile {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 720px) {
  .brand-row {
    align-items: flex-start;
  }

  .action-row,
  .card-header,
  .status-header,
  .result-panel-head,
  .auth-panel-head,
  .history-head {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }
}

.purusa-select {
    position: relative;
    width: 100%;
}

.purusa-select-button {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    border: 1px solid #666;
    border-radius: 12px;
    background: #2b2b2b;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.purusa-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #2b2b2b;
    border: 1px solid #666;
    border-radius: 12px;
    overflow: hidden;
    z-index: 9999;
}

.purusa-select-option {
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    color: #ffffff;
    border: none;
    text-align: left;
    font-size: 18px;
    cursor: pointer;
}

.purusa-select-option:hover {
    background: #f5a623;
    color: #111111;
}
.auth-stage-active {
  background: linear-gradient(135deg, #f6c76f, #d98b35) !important;
  color: #24160a !important;
  border-color: #f6c76f !important;
  opacity: 1 !important;
}

.auth-stage-inactive {
  background: transparent !important;
  color: #f4eadb !important;
  border-color: rgba(244, 234, 219, 0.35) !important;
}

/* Prevent checkbox and custom-select click areas from overlapping */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  flex: 0 0 auto;
}

.checkbox-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}

.field-grid > * {
  min-width: 0;
}

.checkbox-field {
  position: relative;
  z-index: 1;
}

.purusa-select {
  position: relative;
  z-index: 20;
  isolation: isolate;
}

.purusa-select-button,
.purusa-select-menu,
.purusa-select-option {
  pointer-events: auto;
}

/* Landing-page primary actions */
#landing-screen .hero-actions,
#landing-screen .action-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 760px;
  margin: 24px auto 0;
}

#landing-screen #start-btn,
#landing-screen #view-notice-btn {
  width: auto;
  min-width: 230px;
  min-height: 52px;
  padding: 14px 24px;
}

#landing-screen #start-btn {
  order: 1;
}

#landing-screen #view-notice-btn {
  order: 2;
}

@media (max-width: 720px) {
  #landing-screen .hero-actions,
  #landing-screen .action-row {
    flex-direction: column;
    gap: 10px;
  }

  #landing-screen #start-btn,
  #landing-screen #view-notice-btn {
    width: 100%;
    min-width: 0;
  }
}

/* Correct topbar action placement */
.topbar-actions {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 12px !important;
  grid-column: 1 / -1;
  width: 100%;
  max-width: 680px;
  margin: 18px auto 0 !important;
}

.topbar-actions #start-btn,
.topbar-actions #view-notice-btn {
  width: auto !important;
  min-width: 220px;
  min-height: 50px;
  padding: 12px 22px;
}

@media (max-width: 720px) {
  .topbar-actions {
    flex-direction: column !important;
  }

  .topbar-actions #start-btn,
  .topbar-actions #view-notice-btn {
    width: 100% !important;
    min-width: 0;
  }
}

/* Open directly on consultation form */
.topbar-actions,
#notice-box {
  display: none !important;
}

/* Isolate birth-time and concern controls */
.concern-field {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  z-index: 30;
}

.field-label {
  font-size: 0.95rem;
  color: var(--text);
}

#birth-time {
  position: relative;
  pointer-events: auto !important;
  z-index: 5;
}

#birth-time-unknown {
  width: 20px !important;
  height: 20px !important;
  pointer-events: auto !important;
}

#concern-select {
  pointer-events: auto !important;
  isolation: isolate;
}

/* Compact unknown-birth-time checkbox */
#birth-time-unknown {
  appearance: auto !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  padding: 0 !important;
  margin: 0 8px 0 0 !important;
  transform: none !important;
  flex: 0 0 16px !important;
}

.checkbox-field {
  justify-content: flex-start !important;
}

/* Birth-time confirmation and consent state */
.time-confirm-btn {
  width: auto !important;
  min-width: 130px;
  min-height: 38px !important;
  padding: 8px 14px !important;
  justify-self: start;
  font-size: 0.9rem;
}

#privacy-consent {
  accent-color: #e6a64b !important;
}

.checkbox-field:has(#privacy-consent:checked) {
  border-color: #e6a64b !important;
  background: rgba(230, 166, 75, 0.14) !important;
}

.checkbox-field:has(#privacy-consent:checked) span {
  color: #ffd48c !important;
}


/* 2026-08-20 final input-flow cleanup */
#restart-btn {
  display: none !important;
}

#birth-time-confirm {
  font-size: 0.84rem !important;
  white-space: nowrap;
}

.checkbox-field.consent-completed {
  border-color: #f6c76f !important;
  background: rgba(246, 199, 111, 0.13) !important;
}

.checkbox-field.consent-completed span {
  color: #f6d78f !important;
}

#analyze-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: transparent !important;
  color: #f4eadb !important;
}


/* 2026-08-20 first-screen release layout */
#landing-screen {
  display: none !important;
}

.layout {
  display: block !important;
  width: min(100%, 1120px) !important;
  max-width: 1120px !important;
  margin: 0 auto !important;
}

#workspace-screen {
  display: block !important;
  width: 100% !important;
}

#workspace-screen.hidden {
  display: block !important;
}

.pre-result-pdf,
#restart-btn {
  display: none !important;
}

#analysis-status.hidden {
  display: none !important;
}

.auth-panel {
  margin-bottom: 24px !important;
}

.auth-grid {
  align-items: start !important;
}

#analyze-form {
  width: 100% !important;
}

#analyze-btn:disabled {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: rgba(255, 255, 255, 0.55) !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
}

#analyze-btn:not(:disabled) {
  background: linear-gradient(135deg, #f6c76f, #d98b35) !important;
  color: #24160a !important;
}

@media (min-width: 900px) {
  .auth-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #analyze-form .two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .auth-grid,
  #analyze-form .two-col {
    grid-template-columns: 1fr !important;
  }
}


/* 2026-08-20 credential and first-view refinement */
.topbar {
  padding-block: 22px !important;
}

.topbar-copy {
  margin-bottom: 0 !important;
}

.auth-panel {
  padding: 20px !important;
}

.auth-form {
  padding: 18px !important;
}

.auth-form input {
  min-height: 48px !important;
}

.history-panel.login-required {
  opacity: 0.65;
}

#analyze-btn.consent-waiting,
#analyze-btn:disabled {
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

#analyze-btn.consent-ready:not(:disabled) {
  background: linear-gradient(135deg, #f6c76f, #d98b35) !important;
  border-color: #f6c76f !important;
  color: #24160a !important;
  cursor: pointer !important;
}

.checkbox-field.consent-completed {
  border-color: #f6c76f !important;
  background: rgba(246, 199, 111, 0.13) !important;
}

@media (min-width: 900px) {
  .topbar,
  #workspace-screen {
    width: min(100%, 1120px) !important;
    margin-inline: auto !important;
  }
}


/* 2026-08-20 auth sequence final override */
#register-form button[type="submit"].auth-stage-active,
#login-form button[type="submit"].auth-stage-active,
#logout-btn.auth-stage-active {
  background: linear-gradient(
    135deg,
    #f7d27f,
    #efa950,
    #dc8d36
  ) !important;
  color: #211408 !important;
  border-color: #f7d27f !important;
  box-shadow: 0 7px 18px rgba(220, 141, 54, 0.3) !important;
  opacity: 1 !important;
}

#register-form button[type="submit"].auth-stage-inactive,
#login-form button[type="submit"].auth-stage-inactive,
#logout-btn.auth-stage-inactive {
  background: rgba(255, 255, 255, 0.035) !important;
  color: #f3e9dc !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  box-shadow: none !important;
  opacity: 0.78 !important;
}


/* 2026-08-20 unified authentication flow */
#register-form button.auth-flow-active,
#login-form button.auth-flow-active,
#logout-btn.auth-flow-active {
  background: linear-gradient(
    135deg,
    #f7d27f 0%,
    #eead56 52%,
    #d98b35 100%
  ) !important;
  color: #211408 !important;
  border: 1px solid #f7d27f !important;
  box-shadow: 0 7px 18px rgba(217, 139, 53, 0.3) !important;
  opacity: 1 !important;
}

#register-form button.auth-flow-inactive,
#login-form button.auth-flow-inactive,
#logout-btn.auth-flow-inactive {
  background: rgba(255, 255, 255, 0.035) !important;
  color: #f3e9dc !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  box-shadow: none !important;
  opacity: 0.78 !important;
}


/* 2026-08-20 hard authentication stage colors */
html[data-auth-stage="register"]
#register-form button[type="submit"],
html[data-auth-stage="login"]
#login-form button[type="submit"],
html[data-auth-stage="logout"]
#logout-btn {
  background: #ed9b3d !important;
  background-image: linear-gradient(
    135deg,
    #ffd27a 0%,
    #f3a33f 52%,
    #df7d25 100%
  ) !important;
  color: #1f1207 !important;
  border: 2px solid #ffc866 !important;
  box-shadow:
    0 0 0 1px rgba(255, 200, 102, 0.25),
    0 8px 20px rgba(223, 125, 37, 0.35) !important;
  opacity: 1 !important;
}

html[data-auth-stage="register"]
#login-form button[type="submit"],
html[data-auth-stage="register"]
#logout-btn,
html[data-auth-stage="login"]
#register-form button[type="submit"],
html[data-auth-stage="login"]
#logout-btn,
html[data-auth-stage="logout"]
#register-form button[type="submit"],
html[data-auth-stage="logout"]
#login-form button[type="submit"] {
  background: rgba(255, 255, 255, 0.035) !important;
  background-image: none !important;
  color: #f3e9dc !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  box-shadow: none !important;
  opacity: 0.76 !important;
}


/* 2026-08-20 final independent button states */
#register-form button[type="submit"],
#login-form button[type="submit"],
#logout-btn {
  background: rgba(255, 255, 255, 0.045) !important;
  background-image: none !important;
  color: #f4eadb !important;
  border: 1px solid rgba(244, 234, 219, 0.35) !important;
  box-shadow: none !important;
  opacity: 0.82 !important;
}

#register-form button[data-active-auth="true"],
#login-form button[data-active-auth="true"],
#logout-btn[data-active-auth="true"] {
  background: #ed9b3d !important;
  background-image: linear-gradient(
    135deg,
    #ffd27a 0%,
    #f3a33f 52%,
    #df7d25 100%
  ) !important;
  color: #211307 !important;
  border: 2px solid #ffc866 !important;
  box-shadow: 0 8px 20px rgba(223, 125, 37, 0.35) !important;
  opacity: 1 !important;
}

/* ???? ?? ? ?? ?? ?? ?? */
#analyze-btn {
  background: #ed9b3d !important;
  background-image: linear-gradient(
    135deg,
    #ffd27a 0%,
    #f3a33f 52%,
    #df7d25 100%
  ) !important;
  color: #211307 !important;
  border: 2px solid #ffc866 !important;
  box-shadow: 0 8px 20px rgba(223, 125, 37, 0.28) !important;
  opacity: 1 !important;
}

#analyze-btn:disabled {
  background: rgba(255, 255, 255, 0.07) !important;
  background-image: none !important;
  color: rgba(244, 234, 219, 0.55) !important;
  border: 1px solid rgba(244, 234, 219, 0.18) !important;
  box-shadow: none !important;
  opacity: 0.7 !important;
}


/* 2026-08-20 privacy consent neutral checked state */
label.checkbox-field:has(#privacy-consent:checked),
.checkbox-field:has(#privacy-consent:checked),
#privacy-consent:checked + span {
  background: rgba(255, 255, 255, 0.04) !important;
  background-image: none !important;
  color: var(--text) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
  outline: none !important;
}

#privacy-consent {
  accent-color: #2f9de8 !important;
}

#privacy-consent:checked {
  accent-color: #2f9de8 !important;
}


/* 2026-08-20 single active authentication button */
html body #register-form button[type="submit"],
html body #login-form button[type="submit"],
html body #logout-btn,
html[data-auth-stage] body #register-form button[type="submit"],
html[data-auth-stage] body #login-form button[type="submit"],
html[data-auth-stage] body #logout-btn {
  background: rgba(255, 255, 255, 0.045) !important;
  background-image: none !important;
  color: #f4eadb !important;
  border: 1px solid rgba(244, 234, 219, 0.35) !important;
  box-shadow: none !important;
  opacity: 0.82 !important;
}

html body #register-form button[data-active-auth="true"],
html body #login-form button[data-active-auth="true"],
html body #logout-btn[data-active-auth="true"] {
  background: #ed9b3d !important;
  background-image: linear-gradient(
    135deg,
    #ffd27a 0%,
    #f3a33f 52%,
    #df7d25 100%
  ) !important;
  color: #211307 !important;
  border: 2px solid #ffc866 !important;
  box-shadow: 0 8px 20px rgba(223, 125, 37, 0.35) !important;
  opacity: 1 !important;
}

/* consolidated interactive states */

/* Payment consent before immediate digital-content delivery */
.payment-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid rgba(246, 199, 111, 0.35);
  border-radius: 12px;
  background: rgba(246, 199, 111, 0.07);
  line-height: 1.55;
}

.payment-consent input {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: #e89a3e;
}

.payment-consent span {
  font-size: 0.9rem;
}

.payment-consent a {
  color: #f6c76f;
  font-weight: 800;
}


/* concern menu flow and consent isolation */
.concern-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

#concern-select-menu.purusa-select-menu {
  position: static !important;
  inset: auto !important;
  width: 100%;
  margin-top: 6px;
  z-index: auto !important;
}

#analyze-btn.analysis-started,
#analyze-btn.analysis-started:disabled {
  background: rgba(255, 255, 255, 0.07) !important;
  background-image: none !important;
  color: rgba(244, 234, 219, 0.55) !important;
  border: 1px solid rgba(244, 234, 219, 0.18) !important;
  box-shadow: none !important;
}


/* Mobile-visible premium checkout amount */
.premium-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 200, 102, 0.32);
  border-radius: 12px;
  background: rgba(237, 155, 61, 0.08);
  color: #f4eadb;
}

.premium-price strong {
  color: #ffd27a;
  font-size: 1.15rem;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .premium-price {
    display: flex !important;
    width: 100%;
    box-sizing: border-box;
  }

  #upgrade-btn {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    white-space: normal;
    line-height: 1.35;
  }
}


/* Neutral completed consent states on all screen sizes */
html body label.checkbox-field:has(#privacy-consent:checked),
html body label.checkbox-field.consent-completed,
html body label.payment-consent:has(#payment-consent:checked) {
  background: rgba(255, 255, 255, 0.04) !important;
  background-image: none !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
  outline: none !important;
}

html body label.checkbox-field:has(#privacy-consent:checked) span,
html body label.checkbox-field.consent-completed span,
html body label.payment-consent:has(#payment-consent:checked) span,
html body label.payment-consent:has(#payment-consent:checked) a {
  color: var(--text) !important;
  text-shadow: none !important;
}

html body #privacy-consent:checked,
html body #payment-consent:checked {
  accent-color: #2f9de8 !important;
}

/* High-contrast legal policy links */
.legal-footer nav a,
.legal-footer nav a:visited {
  color: #ffd27a !important;
  font-weight: 800;
  text-decoration-color: rgba(255, 210, 122, 0.78);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.legal-footer nav a:hover,
.legal-footer nav a:focus-visible {
  color: #fff2c7 !important;
  text-decoration-color: #fff2c7;
}

.legal-footer .legal-contact a,
.legal-footer .legal-contact a:visited {
  color: inherit;
}


/* Birth date: separate year / month / day selectors */
.birth-date-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.birth-date-title {
  font-weight: 700;
}

.birth-date-selects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.birth-date-selects select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(244, 234, 219, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.birth-date-selects select:focus {
  border-color: #2f9de8;
  outline: 2px solid rgba(47, 157, 232, 0.22);
  outline-offset: 1px;
}

.birth-date-selects select option {
  background: #ffffff;
  color: #161616;
}

@media (max-width: 640px) {
  .birth-date-selects {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .birth-date-selects select {
    min-height: 52px;
    padding: 0 9px;
    font-size: 1rem;
  }
}


/* Birth date + time: year / month / day / time in one row */
.birth-datetime-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.birth-datetime-selects {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.birth-datetime-selects select,
.birth-datetime-selects #birth-time {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(244, 234, 219, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

@media (max-width: 640px) {
  .birth-datetime-selects {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .birth-datetime-selects select,
  .birth-datetime-selects #birth-time {
    min-height: 52px;
    padding: 0 6px;
    font-size: 0.88rem;
  }
}

/* Custom birth-time picker */
.birth-time-button {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(244, 234, 219, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.birth-time-dialog {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.58);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
}

.birth-time-dialog[hidden] {
  display: none !important;
}

.birth-time-sheet {
  width: min(720px, 100%);
  background: #ffffff;
  color: #171717;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.35);
}

.birth-time-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.birth-time-close {
  border: 0;
  background: transparent;
  color: #222;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.birth-time-picker-grid {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1fr;
  gap: 10px;
}

.birth-time-picker-column {
  display: grid;
  gap: 8px;
}

.birth-time-picker-column > span {
  font-weight: 800;
  text-align: center;
}

.birth-time-picker-column select {
  width: 100%;
  min-height: 52px;
  border: 1px solid #d7d7d7;
  border-radius: 10px;
  background: #ffffff;
  color: #111111;
  font-size: 1rem;
  font-weight: 700;
  padding: 0 10px;
}

.birth-time-preview {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #dedede;
  border-radius: 10px;
  font-weight: 800;
  color: #1674e8;
}

.birth-time-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

body.birth-time-dialog-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .birth-time-button {
    min-height: 52px;
    padding: 0 6px;
    font-size: 0.88rem;
  }

  .birth-time-dialog {
    padding: 0;
  }

  .birth-time-sheet {
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 16px 14px 18px;
  }

  .birth-time-picker-grid {
    grid-template-columns: 0.8fr 1fr 1fr;
    gap: 8px;
  }
}

/* Final birth-time button interaction fix */
#birth-time[type="hidden"] {
  display: none !important;
  pointer-events: none !important;
  position: static !important;
  width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
}

.birth-time-button {
  position: relative !important;
  z-index: 50 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

.birth-time-button::after {
  content: " ▼";
  float: right;
  opacity: 0.8;
}

/* Unify year/month/day/time arrows */
#birth-year,
#birth-month,
#birth-day,
#birth-time-button {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #e8ded0 50%),
    linear-gradient(135deg, #e8ded0 50%, transparent 50%) !important;
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50% !important;
  background-size: 5px 5px, 5px 5px !important;
  background-repeat: no-repeat !important;
  padding-right: 34px !important;
}

.birth-time-button::after {
  content: none !important;
}


/* FINAL separated birth-time controls */
.birth-date-field,
.birth-time-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.birth-time-field {
  margin-top: 14px;
}

.birth-date-title,
.birth-time-title {
  font-weight: 800;
}

.birth-date-selects,
.birth-time-selects {
  display: grid;
  width: 100%;
  gap: 8px;
}

.birth-date-selects {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.birth-time-selects {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.birth-date-selects select,
.birth-time-selects select {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0 30px 0 10px;
  border: 1px solid rgba(244, 234, 219, 0.22);
  border-radius: 12px;
  background-color: rgba(255,255,255,0.055);
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.birth-time-unknown-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin-top: 5px;
  cursor: pointer;
}

.birth-time-unknown-row input {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  margin: 0 !important;
}

.birth-time-selects select:disabled {
  opacity: 0.45;
}

#birth-time-period,
#birth-time-hour,
#birth-time-minute {
  appearance: auto !important;
  -webkit-appearance: menulist !important;
}


/* FINAL birth-time dark select fix */
#birth-time-period,
#birth-time-hour,
#birth-time-minute {
  background: #171717 !important;
  background-color: #171717 !important;
  color: #f4eadb !important;
  -webkit-text-fill-color: #f4eadb !important;
  border: 1px solid rgba(244, 234, 219, 0.22) !important;
  color-scheme: dark !important;
}

#birth-time-period option,
#birth-time-hour option,
#birth-time-minute option {
  background-color: #171717 !important;
  color: #f4eadb !important;
}

.footer-brand {
  margin-top: 14px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.78;
}
