/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Subpages — shared styles for privacy, terms,
   and interview pages. Loaded instead of page.css.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Page layout (footer at bottom) ───────────── */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* ── Header (non-sticky for subpages) ────────── */

#site-header {
  position: relative;
  z-index: 100;
  background-color: var(--color-bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto;
  height: 64px;
  padding: 0 var(--space-5);
}

.header-logo {
  height: 64px;
  width: auto;
  display: block;
}

.header-logo-link {
  order: 1;
}

.header-back {
  order: 2;
  margin-left: auto;
}

@media (min-width: 640px) {
  .header-inner {
    height: 72px;
    padding: 0 var(--space-6);
  }
  .header-logo {
    height: 72px;
  }
}

/* ── Footer ──────────────────────────────────── */

#site-footer {
  background: var(--color-footer-bg);
  padding: var(--space-6) var(--space-5);
  text-align: center;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.footer-tagline {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  color: var(--color-text-on-dark);
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.footer-copyright {
  font-size: 0.875rem;
  color: var(--color-text-muted-on-dark);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--color-text-muted-on-dark);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-separator {
  color: var(--color-text-muted-on-dark);
}

@media (min-width: 640px) {
  #site-footer {
    padding: var(--space-8) var(--space-6);
  }
  .footer-inner {
    flex-direction: row;
    justify-content: center;
    gap: var(--space-4);
  }
}

/* ── Legal pages (privacy, terms) ────────────── */

.legal-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px var(--space-5) var(--space-12);
}

@media (min-width: 640px) {
  .legal-page {
    padding: 60px var(--space-6) var(--space-16);
  }
}

.legal-page h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.legal-date {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-10);
}

.legal-page h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-top: var(--space-10);
  margin-bottom: var(--space-3);
}

.legal-page p,
.legal-page ul {
  font-size: 1rem;
  color: var(--color-text-body);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.legal-page ul {
  padding-left: var(--space-5);
}

.legal-page li {
  margin-bottom: var(--space-2);
}

.legal-page a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Interview page ──────────────────────────── */

.interview-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px var(--space-5) var(--space-20);
}

@media (min-width: 640px) {
  .interview-page {
    padding: 60px var(--space-6) var(--space-24);
  }
}

.interview-page h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.interview-page .interview-intro {
  font-size: 1.0625rem;
  color: var(--color-text-body);
  margin-bottom: var(--space-10);
  line-height: 1.6;
}

.interview-intro strong {
  color: var(--color-text-primary);
}

.interview-time {
  display: inline-block;
  margin-top: var(--space-3);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Form controls */

.interview-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.form-group label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.4;
}

.form-group .label-hint {
  display: block;
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.form-group .label-required {
  display: inline-block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--color-accent);
  margin-left: 6px;
  vertical-align: middle;
}

.form-group textarea {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text-primary);
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group textarea::placeholder {
  color: var(--color-text-muted);
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(181, 98, 26, 0.12);
}

.form-group select {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text-primary);
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236B5E54' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(181, 98, 26, 0.12);
}

.interview-form .input-email {
  max-width: none;
}

/* Form sections */

.form-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.form-section-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text-primary);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

/* Question numbering */

.form-group label .q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--color-accent);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-right: 8px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Submit area */

.form-submit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.form-submit .btn-primary {
  min-width: 200px;
}

.form-submit .form-privacy {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  max-width: 400px;
  text-align: left;
}

/* Loading state (class-based toggle for interview form) */

.btn-loading {
  display: none;
}

.btn-primary.is-loading .btn-text {
  display: none;
}

.btn-primary.is-loading .btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Error state */

.interview-error {
  padding: var(--space-3) var(--space-4);
  background: #fef2f2;
  color: var(--color-error);
  border-radius: 8px;
  font-size: 0.875rem;
}

/* Success state */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.interview-success {
  text-align: center;
  padding: var(--space-8) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  animation: fadeInUp 0.5s ease both;
}

.interview-success[hidden] {
  display: none !important;
}

.success-icon {
  margin-bottom: var(--space-6);
  animation: scaleIn 0.4s ease 0.1s both;
}

.interview-success h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
  animation: fadeInUp 0.5s ease 0.15s both;
}

.interview-success p {
  font-size: 1.0625rem;
  color: var(--color-text-body);
  max-width: 480px;
  margin: 0 auto var(--space-8);
  line-height: 1.6;
  animation: fadeInUp 0.5s ease 0.25s both;
}

.success-body {
  animation: fadeInUp 0.5s ease 0.25s both;
}

.success-referral {
  margin-top: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  animation: fadeInUp 0.5s ease 0.35s both;
}

.success-referral-prompt {
  font-size: 0.9375rem;
  color: var(--color-text-body);
  max-width: 400px;
  margin: 0 auto var(--space-5);
  line-height: 1.55;
}

.success-share-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  animation: fadeInUp 0.5s ease 0.4s both;
}

.success-cta {
  min-width: 180px;
}

.success-cta .copy-done {
  color: var(--color-accent-text);
}

.btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-share:hover {
  border-color: #25D366;
  color: #25D366;
  background: rgba(37, 211, 102, 0.06);
}

.success-back {
  display: inline-block;
  margin-top: var(--space-6);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
  animation: fadeInUp 0.5s ease 0.5s both;
}

.success-back:hover {
  color: var(--color-text-body);
}
