/* =============================================
   ASK DIVINITY — Clean Modern Style
   ============================================= */

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

:root {
  --gold:       #B8965A;
  --gold-light: #D4AF6E;
  --gold-pale:  #F5EDD8;
  --ink:        #1A1612;
  --ink-soft:   #4A3F35;
  --ink-muted:  #8A7B6E;
  --bg:         #FDFAF5;
  --bg-card:    #FFFFFF;
  --border:     #E8DFD0;
  --radius:     14px;
  --shadow:     0 4px 24px rgba(26,22,18,0.08);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;
  --transition: 0.25s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---- HEADER ---- */
.site-header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.logo-symbol { color: var(--gold); font-size: 1.2em; }
.logo em { font-style: italic; color: var(--gold); }
.tagline {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0.4rem;
  font-weight: 300;
}

/* ---- MAIN ---- */
#app {
  flex: 1;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1.2rem;
}

/* ---- SCREENS ---- */
.screen { display: none; animation: fadeUp 0.4s ease; }
.screen.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- HOME SCREEN ---- */
.home-intro {
  text-align: center;
  margin-bottom: 2.5rem;
}
.home-intro h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 300;
  line-height: 1.25;
  color: var(--ink);
}
.home-intro h1 em { color: var(--gold); font-style: italic; }
.intro-sub {
  margin-top: 0.9rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
  font-weight: 300;
}
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
@media (max-width: 540px) { .card-grid { grid-template-columns: 1fr; } }

.path-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
}
.path-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.path-card:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 8px 32px rgba(184,150,90,0.15); }
.path-card:hover::before { transform: scaleX(1); }
.card-icon { font-size: 2rem; }
.path-card h2 { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 400; color: var(--ink); }
.path-card p { font-size: 0.88rem; color: var(--ink-muted); line-height: 1.6; font-weight: 300; }
.card-cta { font-size: 0.82rem; color: var(--gold); font-weight: 500; margin-top: 0.5rem; }

/* ---- FORM SCREENS ---- */
.back-btn {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.3rem 0;
  margin-bottom: 1.5rem;
  font-family: var(--font-sans);
  transition: color var(--transition);
}
.back-btn:hover { color: var(--gold); }

.form-header {
  text-align: center;
  margin-bottom: 2rem;
}
.form-icon { font-size: 2.2rem; display: block; margin-bottom: 0.5rem; }
.form-header h2 { font-family: var(--font-serif); font-size: 2rem; font-weight: 400; }
.form-header p { color: var(--ink-muted); font-size: 0.9rem; margin-top: 0.4rem; font-weight: 300; }

.astro-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
@media (max-width: 540px) { .astro-form { padding: 1.2rem; } }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  transition: border-color var(--transition);
  outline: none;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  background: #fff;
}
.form-group textarea { resize: vertical; min-height: 90px; }

/* ---- TOPIC GRID ---- */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
  margin-top: 0.4rem;
}
.topic-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--ink-soft);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}
.topic-btn:hover { border-color: var(--gold); color: var(--gold); }
.topic-btn.selected {
  background: var(--gold-pale);
  border-color: var(--gold);
  color: var(--ink);
  font-weight: 500;
}

/* ---- OPTIONS ROW ---- */
.form-options {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}
.option-group { display: flex; flex-direction: column; gap: 0.4rem; }
.option-group label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  font-weight: 500;
}
.toggle-group { display: flex; gap: 0.4rem; }
.toggle-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--ink-muted);
  cursor: pointer;
  transition: var(--transition);
}
.toggle-btn:hover { border-color: var(--gold); color: var(--gold); }
.toggle-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  font-weight: 500;
}

/* ---- SUBMIT BUTTON ---- */
.submit-btn {
  width: 100%;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 1rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background var(--transition), transform var(--transition);
}
.submit-btn:hover { background: var(--gold); transform: translateY(-1px); }
.submit-btn:active { transform: translateY(0); }

/* ---- LOADING ---- */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  text-align: center;
}
.orbit-loader {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 2rem;
}
.orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  animation: spin 1.4s linear infinite;
}
.orbit-planet {
  position: absolute;
  width: 12px; height: 12px;
  background: var(--gold);
  border-radius: 50%;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  animation: spin 1.4s linear infinite;
}
.orbit-symbol {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--gold);
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-family: var(--font-serif); font-size: 1.3rem; color: var(--ink); }
.loading-sub { font-size: 0.85rem; color: var(--ink-muted); margin-top: 0.5rem; font-weight: 300; }

/* ---- RESULT ---- */
.result-header {
  text-align: center;
  margin-bottom: 1.8rem;
}
.result-icon { font-size: 2.2rem; display: block; margin-bottom: 0.5rem; }
.result-header h2 { font-family: var(--font-serif); font-size: 2rem; font-weight: 400; }
.result-meta { color: var(--ink-muted); font-size: 0.85rem; margin-top: 0.3rem; font-weight: 300; }

.result-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  line-height: 1.8;
  font-size: 0.97rem;
  color: var(--ink-soft);
  white-space: pre-wrap;
  font-family: var(--font-sans);
  font-weight: 300;
  margin-bottom: 1.5rem;
}
@media (max-width: 540px) { .result-body { padding: 1.2rem; } }

.result-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.action-btn {
  flex: 1;
  min-width: 130px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
  font-family: var(--font-sans);
  color: var(--ink-soft);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 400;
}
.action-btn:hover { border-color: var(--gold); color: var(--gold); }
.new-btn { background: var(--ink); color: #fff; border-color: var(--ink); }
.new-btn:hover { background: var(--gold); border-color: var(--gold); color: #fff; }

/* ---- EMAIL FORM ---- */
.email-wrap {
  background: var(--gold-pale);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.email-wrap h3 { font-family: var(--font-serif); font-size: 1.3rem; margin-bottom: 1rem; font-weight: 400; }
.email-note { font-size: 0.85rem; color: var(--ink-muted); margin-bottom: 1rem; line-height: 1.6; }
.hidden { display: none !important; }

/* ---- DISCLAIMER ---- */
.disclaimer {
  font-size: 0.8rem;
  color: var(--ink-muted);
  background: #FFF8EE;
  border: 1px solid #EDD99A;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  line-height: 1.6;
  margin-top: 1rem;
}

/* ---- FOOTER ---- */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
  letter-spacing: 0.05em;
}

/* ---- LOCATION DETECTION ---- */
.location-detect-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.location-btn {
  border: 1px solid var(--gold);
  background: var(--gold-pale);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.location-btn:hover:not(:disabled) {
  background: var(--gold);
  color: #fff;
}
.location-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.location-hint {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 300;
}
.location-status {
  font-size: 0.85rem;
  padding: 0.6rem 0.9rem;
  border-radius: 7px;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.location-status.info    { background: #EEF4FF; color: #3B5BDB; border: 1px solid #BAC8FF; }
.location-status.success { background: #EDFBF1; color: #1A7A3F; border: 1px solid #A8E6BF; }
.location-status.error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* ---- CARD SUBTITLE ---- */
.card-subtitle {
  font-size: 0.82rem;
  color: var(--gold);
  letter-spacing: 0.04em;
  font-style: italic;
  margin-bottom: 0.2rem;
}

/* ---- EMAIL STATUS ---- */
.email-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.email-status.success { background: #EDFBF1; color: #1A7A3F; border: 1px solid #A8E6BF; }
.email-status.error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* ---- COPY TOAST ---- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 0.7rem 1.5rem;
  border-radius: 50px;
  font-size: 0.88rem;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
