/* ===================================================
   DECISION HELPER — Leadership Curators
   Mobile-first dark navy + gold theme
   =================================================== */

:root {
  --navy:      #0d1b2a;
  --navy2:     #1b2d42;
  --navy3:     #243448;
  --gold:      #c9a268;
  --goldLight: #e8c580;
  --goldDark:  #a07d45;
  --white:     #ffffff;
  --offWhite:  #e8edf2;
  --gray:      #8899aa;
  --grayLight: #b0c0d0;
  --cardBg:    #162030;
  --cardBorder:#243448;
  --red:       #e63946;
  --green:     #2a9d4f;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --goldGlow:  0 0 20px rgba(201,162,104,0.35);
  --radius:    14px;
  --radiusSm:  8px;
  --transition: 0.22s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--navy);
  color: var(--white);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ===================================================
   SCREENS
   =================================================== */

.screen {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: var(--navy);
  opacity: 0;
  transition: opacity var(--transition);
  overflow: hidden;
}

.screen.active {
  display: flex;
  opacity: 1;
}

.screen.fade-in {
  animation: fadeIn 0.28s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scrollable inner content */
.screen-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px 24px;
}

.screen-content::-webkit-scrollbar { display: none; }

/* ===================================================
   TOP BAR
   =================================================== */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 52px 20px 16px;
  background: var(--navy);
  flex-shrink: 0;
  border-bottom: 1px solid var(--cardBorder);
}

.top-bar-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.3px;
}

.top-bar-icon-btn {
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
}

.top-bar-icon-btn:hover,
.top-bar-icon-btn:active {
  color: var(--gold);
  background: rgba(201,162,104,0.1);
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 0;
  transition: opacity var(--transition);
}

.back-btn:active { opacity: 0.7; }

.back-btn svg { flex-shrink: 0; }

/* ===================================================
   TYPOGRAPHY
   =================================================== */

.heading-serif {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: var(--gold);
}

.h1 { font-size: 28px; line-height: 1.25; }
.h2 { font-size: 22px; line-height: 1.3; }
.h3 { font-size: 18px; line-height: 1.35; }

.text-gray  { color: var(--gray); }
.text-gold  { color: var(--gold); }
.text-white { color: var(--white); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }

.text-sm  { font-size: 13px; }
.text-xs  { font-size: 11px; }
.text-md  { font-size: 15px; }

.italic { font-style: italic; }
.fw-600 { font-weight: 600; }
.fw-500 { font-weight: 500; }

/* ===================================================
   BUTTONS
   =================================================== */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  letter-spacing: 0.3px;
  -webkit-appearance: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--goldLight) 100%);
  color: var(--navy);
  box-shadow: var(--goldGlow), 0 4px 16px rgba(201,162,104,0.25);
}

.btn-gold:hover, .btn-gold:active {
  background: linear-gradient(135deg, var(--goldLight) 0%, var(--gold) 100%);
  box-shadow: 0 0 28px rgba(201,162,104,0.5), 0 6px 20px rgba(201,162,104,0.3);
  transform: translateY(-1px);
}

.btn-gold:disabled {
  background: var(--navy3);
  color: var(--gray);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}

.btn-outline:hover, .btn-outline:active {
  background: rgba(201,162,104,0.08);
  box-shadow: var(--goldGlow);
}

.btn-ghost {
  background: var(--cardBg);
  color: var(--white);
  border: 1px solid var(--cardBorder);
}

.btn-ghost:hover, .btn-ghost:active {
  background: var(--navy3);
  border-color: var(--gray);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1.5px solid var(--red);
}

.btn-danger:hover, .btn-danger:active {
  background: rgba(230,57,70,0.1);
}

.btn-sm {
  padding: 11px 18px;
  font-size: 14px;
  border-radius: var(--radiusSm);
}

.btn-link {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
  padding: 4px 0;
  font-family: 'Inter', sans-serif;
}

.btn-link:hover { color: var(--goldLight); }

/* ===================================================
   FORM ELEMENTS
   =================================================== */

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--grayLight);
  margin-bottom: 8px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--cardBg);
  border: 1.5px solid var(--cardBorder);
  border-radius: var(--radiusSm);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  padding: 14px 16px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--gray);
  font-size: 15px;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,104,0.15);
}

.form-textarea {
  resize: none;
  line-height: 1.6;
  min-height: 140px;
}

.form-textarea.large {
  min-height: 180px;
}

.char-count {
  display: flex;
  justify-content: flex-end;
  font-size: 12px;
  color: var(--gray);
  margin-top: 6px;
}

.char-count.warning { color: var(--gold); }
.char-count.error   { color: var(--red); }

/* ===================================================
   CARDS
   =================================================== */

.card {
  background: var(--cardBg);
  border: 1px solid var(--cardBorder);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  transition: all var(--transition);
}

.card-tappable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.card-tappable:hover,
.card-tappable:active {
  border-color: var(--gold);
  background: var(--navy3);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-label {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.card-label-gold {
  background: rgba(201,162,104,0.15);
  color: var(--gold);
  border: 1px solid rgba(201,162,104,0.3);
}

.card-label-green {
  background: rgba(42,157,79,0.15);
  color: var(--green);
  border: 1px solid rgba(42,157,79,0.3);
}

/* ===================================================
   PROGRESS BAR
   =================================================== */

.progress-container {
  padding: 12px 20px;
  background: var(--navy);
  flex-shrink: 0;
  border-bottom: 1px solid var(--cardBorder);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-track {
  height: 4px;
  background: var(--navy3);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--goldLight));
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ===================================================
   BOTTOM NAVIGATION
   =================================================== */

.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--navy2);
  border-top: 1px solid var(--cardBorder);
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 20px;
  color: var(--gray);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: color var(--transition);
  flex: 1;
}

.nav-tab svg {
  transition: transform var(--transition);
}

.nav-tab.active {
  color: var(--gold);
}

.nav-tab.active svg {
  transform: scale(1.1);
}

.nav-tab:active { opacity: 0.7; }

/* ===================================================
   SPINNER / LOADING
   =================================================== */

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 20px;
  flex: 1;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--cardBorder);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
  display: inline-block;
}

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

.loading-text {
  color: var(--gray);
  font-size: 15px;
  text-align: center;
}

/* ===================================================
   TOAST NOTIFICATIONS
   =================================================== */

#toast-container {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: 90%;
  max-width: 360px;
}

.toast {
  background: var(--navy2);
  border: 1px solid var(--cardBorder);
  border-radius: var(--radiusSm);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  box-shadow: var(--shadow);
  animation: toastIn 0.25s ease;
  width: 100%;
  text-align: center;
}

.toast.success {
  border-color: var(--green);
  color: var(--green);
  background: rgba(42,157,79,0.12);
}

.toast.error {
  border-color: var(--red);
  color: var(--red);
  background: rgba(230,57,70,0.12);
}

.toast.info {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,162,104,0.1);
}

.toast.fade-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(10px); }
}

/* ===================================================
   LOGIN SCREEN
   =================================================== */

.auth-screen {
  justify-content: center;
  padding: 0 24px;
  background: linear-gradient(180deg, #0a1520 0%, var(--navy) 60%);
  overflow-y: auto;
}

.auth-logo {
  text-align: center;
  margin-bottom: 40px;
  padding-top: 60px;
}

.auth-logo-icon {
  margin: 0 auto 16px;
  width: 72px;
  height: 72px;
}

.auth-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.auth-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--gray);
}

.auth-card {
  background: var(--cardBg);
  border: 1px solid var(--cardBorder);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 20px;
}

.auth-footer {
  text-align: center;
  padding-bottom: 40px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--gray);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cardBorder);
}

/* ===================================================
   HOME SCREEN
   =================================================== */

.welcome-section {
  padding: 28px 0 20px;
}

.welcome-greeting {
  font-size: 22px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}

.welcome-sub {
  font-size: 14px;
  color: var(--gray);
}

.hero-btn-wrap {
  margin: 24px 0;
}

.hero-btn {
  padding: 20px 24px;
  font-size: 17px;
  border-radius: 16px;
  box-shadow: var(--goldGlow), 0 8px 32px rgba(201,162,104,0.2);
}

.section-heading {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 14px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray);
}

.empty-state-icon {
  margin: 0 auto 16px;
  opacity: 0.4;
}

/* ===================================================
   NEW DECISION SCREEN
   =================================================== */

.screen-header {
  padding: 52px 20px 16px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--cardBorder);
}

.screen-header-inner {
  padding-bottom: 4px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.chip {
  background: var(--cardBg);
  border: 1px solid var(--cardBorder);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--grayLight);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}

.chip:hover, .chip:active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,162,104,0.08);
}

/* ===================================================
   QUESTIONS SCREEN
   =================================================== */

.question-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.question-text {
  font-size: 19px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.45;
  margin-bottom: 8px;
}

.question-hint {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ===================================================
   RESULT SCREEN
   =================================================== */

.wisdom-header {
  padding: 28px 0 16px;
  text-align: center;
  border-bottom: 1px solid var(--cardBorder);
  margin-bottom: 20px;
}

.wisdom-situation {
  background: var(--cardBg);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radiusSm) var(--radiusSm) 0;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--grayLight);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 20px;
}

.wisdom-body {
  color: var(--offWhite);
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 24px;
}

.wisdom-body p {
  margin-bottom: 16px;
}

.wisdom-body strong {
  color: var(--gold);
  font-weight: 600;
}

.wisdom-body em {
  color: var(--grayLight);
}

.wisdom-section {
  background: var(--cardBg);
  border: 1px solid var(--cardBorder);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}

.wisdom-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wisdom-section-text {
  font-size: 15px;
  color: var(--offWhite);
  line-height: 1.7;
}

.wisdom-cta {
  margin-top: 8px;
}

.wisdom-cta .btn {
  margin-bottom: 12px;
}

/* ===================================================
   HISTORY SCREEN
   =================================================== */

.history-card {
  background: var(--cardBg);
  border: 1px solid var(--cardBorder);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: all var(--transition);
}

.history-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  gap: 12px;
}

.history-card-header:active {
  background: var(--navy3);
}

.history-card-meta {
  font-size: 11px;
  color: var(--gray);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.history-card-excerpt {
  font-size: 14px;
  color: var(--offWhite);
  line-height: 1.45;
}

.history-card-expand {
  color: var(--gray);
  flex-shrink: 0;
  margin-top: 2px;
  transition: transform var(--transition);
}

.history-card.expanded .history-card-expand {
  transform: rotate(180deg);
}

.history-card-body {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid var(--cardBorder);
}

.history-card.expanded .history-card-body {
  display: block;
}

.history-wisdom-text {
  font-size: 14px;
  color: var(--offWhite);
  line-height: 1.7;
  padding-top: 14px;
  white-space: pre-wrap;
}

/* ===================================================
   PROFILE SCREEN
   =================================================== */

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 24px;
  border-bottom: 1px solid var(--cardBorder);
  margin-bottom: 24px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--goldDark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
  border: 2px solid rgba(201,162,104,0.4);
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.profile-email {
  font-size: 13px;
  color: var(--gray);
}

.stat-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  flex: 1;
  background: var(--cardBg);
  border: 1px solid var(--cardBorder);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 0.3px;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===================================================
   MISC UTILITIES
   =================================================== */

.divider {
  height: 1px;
  background: var(--cardBorder);
  margin: 20px 0;
}

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.text-center { text-align: center; }
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.w-full { width: 100%; }

/* Safe area padding for modern phones */
.safe-bottom {
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

/* Shimmer loading state */
.shimmer {
  background: linear-gradient(90deg, var(--cardBg) 25%, var(--navy3) 50%, var(--cardBg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radiusSm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.shimmer-line {
  height: 14px;
  margin-bottom: 10px;
}

.shimmer-line.short { width: 60%; }
.shimmer-line.medium { width: 80%; }
.shimmer-line.long { width: 100%; }

/* Gold separator ornament */
.ornament {
  text-align: center;
  color: var(--gold);
  font-size: 18px;
  letter-spacing: 8px;
  opacity: 0.6;
  margin: 16px 0;
}

/* ===================================================
   LANDSCAPE / LARGER SCREENS
   =================================================== */

@media (min-width: 480px) {
  #app {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
  }

  body {
    background: #050e18;
    display: flex;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
