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

:root {
  /* Quiet Luxury Palette */
  --bg: #F6F4EF;
  --bg-warm: #F0EDE6;
  --charcoal: #2B2B2B;
  --charcoal-soft: #3D3D3D;
  --sage: #8A9A7E;
  --sage-light: #E8ECE4;
  --sage-dark: #6B7D61;
  --sage-muted: rgba(138, 154, 126, 0.12);

  --text-primary: #2B2B2B;
  --text-secondary: #5C5C5C;
  --text-muted: #8E8E8E;
  --text-inverse: #F6F4EF;

  --surface: #FFFFFF;
  --border: rgba(43, 43, 43, 0.06);
  --border-hover: rgba(43, 43, 43, 0.12);

  --error: #B5706B;
  --error-bg: rgba(181, 112, 107, 0.08);
  --success: #8A9A7E;
  --success-bg: rgba(138, 154, 126, 0.08);

  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  --radius: 8px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.03);
  --shadow-lifted: 0 8px 40px rgba(0, 0, 0, 0.06);

  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition: 0.35s var(--ease);
}

html {
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--text-primary);
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: 0.01em;
}

/* ===== Typography ===== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

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

/* ===== Layout ===== */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 4rem;
  background: transparent;
  position: relative;
  z-index: 10;
}

.site-main {
  flex: 1;
  width: 100%;
}

.site-footer {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ===== Navigation ===== */

.site-nav {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.nav-logo {
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--charcoal);
  letter-spacing: -0.01em;
  transition: opacity var(--transition);
}

.nav-logo:hover {
  opacity: 0.7;
}

.nav-list {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
}

/* ===== Auth ===== */

.header-auth {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.auth-user-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.auth-button {
  padding: 0.65rem 1.75rem;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all var(--transition);
}

.auth-button--signin {
  background: var(--charcoal);
  color: var(--text-inverse);
}

.auth-button--signin:hover {
  background: var(--charcoal-soft);
}

.auth-button--signout {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.auth-button--signout:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.auth-loading {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* ===== Hero (Landing) ===== */

.hero {
  text-align: center;
  padding: 8rem 2rem 10rem;
  max-width: 1000px;
  margin: 0 auto;
}

.hero-logo {
  display: block;
  margin: 0 auto 4rem;
  height: 48px;
  width: auto;
  opacity: 0.85;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 4.5rem;
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: 2rem;
  color: var(--charcoal);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 6rem;
  line-height: 1.8;
}

.cta-message {
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}

.hero-divider {
  width: 48px;
  height: 1px;
  background: var(--border-hover);
  margin: 0 auto 6rem;
  border: none;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem;
  margin-bottom: 6rem;
  text-align: left;
}

.feature {
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.feature-number {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 300;
  color: var(--sage);
  line-height: 1;
  margin-bottom: 1.5rem;
  opacity: 0.6;
}

.feature-icon {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 300;
  color: var(--sage);
  line-height: 1;
  margin-bottom: 1.5rem;
  opacity: 0.6;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  display: block;
  align-items: initial;
  justify-content: initial;
}

.feature h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.feature p {
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== CTA Button ===== */

.landing-cta {
  margin-top: 0;
}

.cta-button {
  display: inline-block;
  padding: 1rem 3rem;
  background: var(--charcoal);
  color: var(--text-inverse);
  text-decoration: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
}

.cta-button:hover {
  background: var(--charcoal-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

/* ===== Buttons ===== */

.btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  transition: all var(--transition);
}

.btn--primary {
  background: var(--charcoal);
  color: var(--text-inverse);
}

.btn--primary:hover {
  background: var(--charcoal-soft);
}

.btn--primary:disabled {
  background: var(--bg-warm);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn--secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ===== Send Now ===== */

.send-now-btn {
  margin-top: 2.5rem;
  display: block;
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Forms ===== */

.form-field {
  margin-bottom: 2rem;
}

.form-field label,
.form-label {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 0.9rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  font-weight: 300;
  background: var(--surface);
  color: var(--text-primary);
  transition: all var(--transition);
  letter-spacing: 0.01em;
}

.form-input:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-muted);
}

.form-input::placeholder {
  color: var(--text-muted);
  font-weight: 300;
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
  line-height: 1.7;
}

select.form-input {
  appearance: auto;
}

.field-hint {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.01em;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
}

/* ===== Messages ===== */

.form-message {
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  font-size: 0.9rem;
  font-weight: 300;
}

.form-message--success {
  background: var(--success-bg);
  color: var(--sage-dark);
  border: 1px solid rgba(138, 154, 126, 0.15);
}

.form-message--error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(181, 112, 107, 0.12);
}

.form-error {
  color: var(--error);
  font-weight: 300;
}

.auth-prompt {
  color: var(--text-muted);
  font-weight: 300;
  text-align: center;
  padding: 4rem 0;
  font-size: 1rem;
}

.step-error {
  color: var(--error);
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  font-weight: 300;
}

/* ===== Toast ===== */

.toast {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  padding: 1.25rem 1.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 300;
  z-index: 1000;
  animation: toast-in 0.5s var(--ease);
  max-width: 380px;
  box-shadow: var(--shadow-lifted);
  background: var(--surface);
}

.toast--error {
  border-left: 3px solid var(--error);
  color: var(--error);
}

.toast--success {
  border-left: 3px solid var(--sage);
  color: var(--sage-dark);
}

.toast--info {
  border-left: 3px solid var(--charcoal);
  color: var(--text-primary);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(1rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Onboarding ===== */

.onboarding {
  max-width: 560px;
  margin: 4rem auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 3.5rem 3.5rem 3rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.onboarding-progress {
  height: 2px;
  background: var(--bg-warm);
  border-radius: 1px;
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.onboarding-progress-bar {
  height: 100%;
  background: var(--sage);
  border-radius: 1px;
  transition: width 0.5s var(--ease);
}

.onboarding-step-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 400;
}

.onboarding-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.onboarding-desc {
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.7;
}

.onboarding-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.onboarding-form {
  /* container for each step's form content */
}

/* ===== Focus area chips ===== */

.focus-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.focus-chip {
  padding: 0.65rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-secondary);
  transition: all 0.25s var(--ease);
  letter-spacing: 0.02em;
}

.focus-chip:hover {
  border-color: var(--sage);
  color: var(--sage-dark);
}

.focus-chip--selected {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

/* ===== Tone cards ===== */

.tone-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.tone-card {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all 0.3s var(--ease);
}

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

.tone-card--selected {
  border-color: var(--sage);
  background: var(--sage-muted);
}

.tone-card strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
}

.tone-card span {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-secondary);
}

/* ===== Delivery time list ===== */

.delivery-time-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.delivery-time-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.delivery-time-select {
  flex: 1;
  max-width: 200px;
}

.btn-remove-time {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}

.btn-remove-time:hover {
  border-color: var(--error);
  color: var(--error);
}

.btn-add-time {
  margin-top: 0.5rem;
  padding: 0.5rem 1.25rem;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease);
}

.btn-add-time:hover {
  border-color: var(--sage);
  color: var(--sage-dark);
}

/* ===== Field value (read-only display) ===== */

.field-value {
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text-primary);
  padding: 0.9rem 1.25rem;
  background: var(--bg-warm);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ===== Destination checkboxes ===== */

.dest-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dest-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--sage);
}

/* ===== Dashboard ===== */

.dashboard {
  max-width: 640px;
  margin: 4rem auto;
  padding: 0 2rem;
}

.dashboard-links {
  text-align: center;
  margin: 2.5rem 0;
}

.dashboard-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.dashboard-link:hover {
  color: var(--text-primary);
}

/* ===== Affirmation Card ===== */

.affirmation-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 4rem 3rem;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  position: relative;
}

.affirmation-card--empty {
  padding: 4rem 3rem;
}

.affirmation-card--empty h2 {
  font-size: 1.6rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

.affirmation-card--empty p {
  color: var(--text-secondary);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
}

.affirmation-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sage);
  margin-bottom: 2rem;
  font-weight: 500;
}

.affirmation-text {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
}

.affirmation-date {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  letter-spacing: 0.02em;
}

/* ===== Star Rating ===== */

.rating-section {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.rating-label {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.star-rating {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.75rem;
  color: var(--bg-warm);
  transition: all 0.2s var(--ease);
  padding: 0.25rem;
}

.star:hover,
.star--filled {
  color: var(--sage);
}

.star:hover {
  transform: scale(1.15);
}

/* ===== History ===== */

.history-section {
  margin-top: 4rem;
}

.history-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
}

.history-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
}

.history-item {
  padding: 1.75rem 2rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}

.history-item:hover {
  border-color: var(--border-hover);
}

.history-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-muted);
}

.history-rating {
  color: var(--sage);
}

/* ===== Settings ===== */

.settings {
  max-width: 560px;
  margin: 4rem auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 3.5rem 3.5rem 3rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.settings-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 2.5rem;
  letter-spacing: -0.01em;
}

.settings-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 300;
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
  .site-header {
    padding: 1.25rem 1.5rem;
    flex-direction: column;
    gap: 1rem;
  }

  .site-nav {
    gap: 2rem;
  }

  .nav-list {
    gap: 1.5rem;
  }

  .site-main {
    padding: 0;
  }

  .hero {
    padding: 4rem 1.5rem 6rem;
  }

  .hero-title {
    font-size: 2.75rem;
  }

  .hero-subtitle {
    margin-bottom: 4rem;
  }

  .hero-features {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 0 0.5rem;
    margin-bottom: 4rem;
  }

  .tone-grid {
    grid-template-columns: 1fr;
  }

  .onboarding,
  .settings {
    margin: 2rem 1rem;
    padding: 2.5rem 2rem 2rem;
    border-radius: var(--radius);
  }

  .affirmation-card {
    padding: 3rem 2rem;
    border-radius: var(--radius);
  }

  .dashboard {
    margin: 2rem auto;
    padding: 0 1.25rem;
  }

  .history-item {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.25rem;
  }

  .hero-features {
    gap: 2rem;
  }

  .onboarding,
  .settings {
    padding: 2rem 1.5rem 1.5rem;
  }
}
