/* ===== Design Tokens (matching landing page) ===== */
:root {
  --color-bg: #1a1a2e;
  --color-gold: #e8c88a;
  --color-gold-bright: #ffddaa;
  --color-self: #fff5d4;
  --color-warm: #ff9944;
  --color-cool: #64b4dc;
  --color-muted: rgba(232, 200, 138, 0.65);
  --color-surface: rgba(0, 0, 0, 0.3);
  --color-border: rgba(232, 200, 138, 0.15);

  --font-heading: 'Playfair Display', serif;
  --font-body: 'Cormorant Garamond', serif;

  --radius-pill: 28px;
  --radius-card: 12px;

  /* Validation colors */
  --color-error: #e85555;
  --color-success: #5cb85c;
}

/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-gold);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: var(--color-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav__flame {
  width: 18px;
  height: 28px;
}

.nav__name {
  font-family: var(--font-heading);
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--color-gold);
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav__username {
  font-size: 14px;
  color: var(--color-muted);
}

.nav__login {
  font-size: 13px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  border-radius: var(--radius-pill);
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  opacity: 0.85;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-warm), var(--color-gold));
  color: var(--color-bg);
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn--primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn--outline {
  border: 1px solid var(--color-gold);
  color: var(--color-gold);
  padding: 8px 20px;
}

.btn--ghost {
  color: var(--color-muted);
  padding: 8px 16px;
  font-size: 13px;
  border: none;
  background: none;
}

.btn--ghost:hover {
  color: var(--color-gold);
  opacity: 1;
}

/* ===== Main Content ===== */
.main {
  padding-top: 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== Flash Messages ===== */
.flash-messages {
  width: 100%;
  max-width: 560px;
  padding: 0 28px;
  margin-bottom: 16px;
}

.flash {
  padding: 12px 20px;
  border-radius: var(--radius-card);
  font-size: 14px;
  text-align: center;
}

.flash--success {
  background: rgba(92, 184, 92, 0.15);
  border: 1px solid rgba(92, 184, 92, 0.3);
  color: var(--color-success);
}

.flash--error {
  background: rgba(232, 85, 85, 0.15);
  border: 1px solid rgba(232, 85, 85, 0.3);
  color: var(--color-error);
}

/* ===== Form Card ===== */
.form-card {
  width: 100%;
  max-width: 560px;
  padding: 40px 28px 60px;
}

.form-card__title {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--color-gold-bright);
  text-align: center;
  margin-bottom: 32px;
}

/* ===== Form Sections ===== */
.form-section {
  margin-bottom: 32px;
}

.form-section__heading {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--color-gold);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

/* ===== Form Fields ===== */
.field {
  margin-bottom: 20px;
}

.field__label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  transition: color 0.2s ease;
}

.field__label--required::after {
  content: ' *';
  color: var(--color-error);
}

.field__label--invalid {
  color: var(--color-error);
}

.field__label--valid {
  color: var(--color-success);
}

.field__input {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-gold-bright);
  transition: border-color 0.2s ease;
}

.field__input:focus {
  outline: none;
  border-color: var(--color-gold);
}

.field__input option {
  background: var(--color-bg);
  color: var(--color-gold);
  padding: 8px;
}

.field__input--error {
  border-color: var(--color-error);
}

.field__input--valid {
  border-color: var(--color-success);
}

.field__input-wrap {
  position: relative;
}

.field__error {
  font-size: 12px;
  color: var(--color-error);
  margin-top: 4px;
}

.field__hint {
  font-size: 12px;
  color: var(--color-muted);
  font-style: italic;
  margin-top: 4px;
}

.field__avail {
  font-size: 12px;
  margin-top: 4px;
}

.field__avail--valid {
  color: var(--color-success);
}

.field__avail--invalid {
  color: var(--color-error);
}

.field__status {
  font-size: 12px;
  margin-top: 4px;
}

.field__status--valid {
  color: var(--color-success);
}

.field__status--invalid {
  color: var(--color-error);
}

/* ===== Verify Button ===== */
.field__row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.field__row .field__input {
  flex: 1;
}

.btn--verify {
  padding: 10px 18px;
  font-size: 14px;
  background: rgba(232, 200, 138, 0.1);
  border: 1px solid var(--color-gold);
  color: var(--color-gold);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.btn--verify:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.field__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: field-spin 0.6s linear infinite;
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: -8px;
  pointer-events: none;
}

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

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

/* ===== Avatar Cards ===== */
.avatar-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.avatar-card {
  flex: 1;
  min-width: 200px;
  padding: 20px;
  border-radius: var(--radius-card);
  background: rgba(255, 153, 68, 0.06);
  border: 2px solid var(--color-border);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease;
}

.avatar-card:hover {
  border-color: var(--color-warm);
}

.avatar-card--selected {
  border-color: var(--color-warm);
  background: rgba(255, 153, 68, 0.12);
}

.avatar-card input[type="radio"] {
  display: none;
}

.avatar-card__name {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--color-warm);
  margin-bottom: 4px;
}

.avatar-card__note {
  font-size: 12px;
  color: var(--color-muted);
  font-style: italic;
}

/* ===== Radio Group and Labels ===== */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.radio-label:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--color-gold);
}

.radio-label input[type="radio"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--color-gold);
  cursor: pointer;
}

.radio-label input[type="radio"]:checked ~ .radio-label__text {
  color: var(--color-gold-bright);
}

.radio-label__text {
  display: block;
  font-size: 15px;
  color: var(--color-gold);
  font-weight: 500;
  margin-bottom: 4px;
  transition: color 0.2s ease;
}

.radio-label__desc {
  display: block;
  font-size: 13px;
  color: var(--color-muted);
}

/* ===== Strength Meter ===== */
.strength-meter {
  margin-top: 8px;
}

.strength-meter__bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.strength-meter__bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-meter__label {
  font-size: 12px;
  margin-top: 4px;
  transition: color 0.2s ease;
}

.strength-meter__suggestions {
  list-style: none;
  padding: 0;
  margin-top: 4px;
}

.strength-meter__suggestions li {
  font-size: 11px;
  color: var(--color-muted);
}

/* ===== Disclaimer ===== */
.disclaimer {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
}

.checkbox-field input[type="checkbox"] {
  margin-top: 4px;
  accent-color: var(--color-gold);
}

.checkbox-field label {
  font-size: 14px;
  color: var(--color-gold);
}

/* ===== API Status ===== */
.api-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 24px;
}

.api-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.api-status__dot--available {
  background: var(--color-success);
}

.api-status__dot--unavailable {
  background: var(--color-error);
}

/* ===== Login Form ===== */
.login-error {
  text-align: center;
  color: var(--color-error);
  font-size: 14px;
  margin-bottom: 16px;
}

.form-card__link {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--color-muted);
}

.form-card__link a {
  color: var(--color-gold);
}

.form-card__link a:hover {
  color: var(--color-gold-bright);
}

/* ===== Dashboard ===== */
.dashboard {
  text-align: center;
  padding-top: 120px;
}

.dashboard__welcome {
  font-family: var(--font-heading);
  font-size: 32px;
  color: var(--color-gold-bright);
  margin-bottom: 12px;
}

.dashboard__subtitle {
  font-size: 16px;
  color: var(--color-muted);
  font-style: italic;
}

/* ===== Submit ===== */
.form-card__submit {
  text-align: center;
  margin-top: 32px;
}

/* ===== Responsive (<=768px) ===== */
@media (max-width: 768px) {
  .nav {
    padding: 12px 16px;
  }

  .nav__name {
    font-size: 13px;
  }

  .form-card {
    padding: 24px 16px 40px;
  }

  .form-card__title {
    font-size: 24px;
  }

  .avatar-cards {
    flex-direction: column;
  }

  .field__row {
    flex-direction: column;
  }

  .btn--verify {
    width: 100%;
  }

  .dashboard__welcome {
    font-size: 26px;
  }
}

/* ===== FAQ Page ===== */
.faq {
  width: 100%;
  max-width: 720px;
  padding: 48px 28px 80px;
}

.faq__title {
  font-family: var(--font-heading);
  font-size: 32px;
  color: var(--color-gold-bright);
  text-align: center;
  margin-bottom: 48px;
}

.faq__list {
  border-top: 1px solid var(--color-border);
}

.faq__item {
  border-bottom: 1px solid var(--color-border);
}

.faq__item summary {
  list-style: none;
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

.faq__question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--color-gold);
  cursor: pointer;
  transition: color 0.2s ease;
  gap: 16px;
}

.faq__question:hover {
  color: var(--color-gold-bright);
}

.faq__question::after {
  content: '+';
  font-size: 20px;
  color: var(--color-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
  line-height: 1;
}

.faq__item[open] > .faq__question::after {
  content: '\2212';
}

.faq__answer {
  padding: 0 0 20px 16px;
}

.faq__answer p {
  font-size: 15px;
  color: var(--color-muted);
  line-height: 1.75;
}

/* ===== About Page ===== */
.about {
  width: 100%;
  max-width: 680px;
  padding: 48px 28px 80px;
}

.about__label {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(232, 200, 138, 0.45);
  margin-bottom: 48px;
}

.about__letter {
  font-size: 19px;
  font-weight: 300;
  line-height: 1.85;
  color: rgba(232, 200, 138, 0.88);
}

.about__salutation {
  font-family: var(--font-heading);
  font-size: 22px;
  font-style: italic;
  color: var(--color-gold-bright);
  margin-bottom: 32px;
}

.about__letter p {
  margin-bottom: 28px;
}

.about__highlight {
  color: var(--color-gold-bright);
  font-size: 20px;
  font-style: italic;
}

.about__blockquote {
  border-left: 2px solid rgba(255, 153, 68, 0.4);
  padding-left: 24px;
  margin: 36px 0;
  font-style: italic;
  color: rgba(232, 200, 138, 0.7);
  font-size: 18px;
}

.about__close {
  margin-top: 48px;
  font-family: var(--font-heading);
}

.about__sign-off {
  font-style: italic;
  color: rgba(232, 200, 138, 0.6);
  margin-bottom: 12px;
}

.about__name {
  font-size: 20px;
  color: var(--color-gold-bright);
}

.about__photo-block {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}

.about__photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(232, 200, 138, 0.2);
  background: rgba(232, 200, 138, 0.1);
}

.about__photo-caption {
  font-size: 13px;
  font-style: italic;
  color: rgba(232, 200, 138, 0.45);
  line-height: 1.6;
}

.about__photo-caption strong {
  display: block;
  font-style: normal;
  font-size: 15px;
  color: rgba(232, 200, 138, 0.7);
  margin-bottom: 3px;
}

@media (max-width: 768px) {
  .about__letter {
    font-size: 17px;
  }

  .about {
    padding: 32px 16px 60px;
  }
}

/* ===== Accessibility ===== */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .spinner,
  .field__spinner {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }

  .strength-meter__bar {
    transition: none;
  }

  .field__label,
  .field__input,
  .strength-meter__label {
    transition: none;
  }
}
