/* ============================================================
   amipregnant.com.au — Brand Design System
   Palette: Dusty Rose & Sage (Warm Comfort)
   ============================================================ */

:root {
  /* Primary brand colours — Dusty Rose */
  --purple-900: #6B3D4E;  /* deep rose    — replaces purple-900 */
  --purple-800: #8A5F6E;  /* dark rose    — replaces purple-800 */
  --purple-700: #9A6E7C;  /* hover state  — replaces purple-700 */
  --purple-600: #B07A8C;  /* primary      — replaces purple-600 */
  --purple-500: #A7BBA6;  /* sage         — replaces purple-500 */
  --purple-400: #C4D3C3;  /* light sage   — replaces purple-400 */
  --purple-100: #DDE8DC;  /* pale sage    — replaces purple-100 */
  --purple-50:  #EDE4D9;  /* warm cream   — replaces purple-50  */

  /* Accent colours — Warm Cream / Sage tones */
  --orange-600: #C4A882;  /* deep cream   — replaces orange-600 */
  --orange-500: #A7BBA6;  /* sage accent  — replaces orange-500 */
  --orange-400: #BDD0BC;  /* light sage   — replaces orange-400 */
  --orange-100: #E8F0E7;  /* pale sage    — replaces orange-100 */
  --orange-50:  #F4F8F4;  /* sage mist    — replaces orange-50  */

  /* Neutral — warm greys anchored to brand */
  --grey-900: #3D2B32;  /* deep warm dark */
  --grey-700: #6B6B6B;  /* tagline text   */
  --grey-600: #7A7A7A;
  --grey-500: #9A9A9A;
  --grey-400: #B8B0B3;
  --grey-300: #D4CCCE;
  --grey-200: #E8E0E3;
  --grey-100: #F2ECEE;
  --grey-50:  #FBF9F6;  /* off-white page bg */
  --white:    #FFFFFF;

  /* Semantic */
  --color-brand:   var(--purple-600);   /* Dusty Rose  */
  --color-cta:     var(--purple-600);   /* CTA matches primary */
  --color-text:    var(--grey-700);     /* Dark Gray body text */
  --color-muted:   var(--grey-500);
  --color-border:  var(--grey-200);
  --color-bg:      var(--white);
  --color-surface: var(--grey-50);      /* Off-white page bg */

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs:   0.75rem;
  --font-size-sm:   0.875rem;
  --font-size-base: 1rem;
  --font-size-lg:   1.125rem;
  --font-size-xl:   1.25rem;
  --font-size-2xl:  1.5rem;
  --font-size-3xl:  1.875rem;
  --font-size-4xl:  2.25rem;
  --font-size-5xl:  3rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Radius */
  --radius-sm:  0.375rem;
  --radius-md:  0.5rem;
  --radius-lg:  0.75rem;
  --radius-xl:  1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Nav */
  --nav-height: 96px;
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

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

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

/* Logo in nav */
.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.nav-logo img,
.nav-logo svg {
  height: var(--nav-height);
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-links a {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--grey-600);
  transition: color var(--transition-fast);
}

.nav-links a:hover { color: var(--color-brand); }

.nav-cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-base);
  font-weight: 600;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
}

/* On narrow screens, allow hero/CTA long buttons to wrap rather than overflow */
@media (max-width: 480px) {
  .btn-lg {
    white-space: normal;
    text-align: center;
    line-height: 1.4;
  }
}

.btn-primary {
  background: var(--color-cta);
  color: var(--white);
  border-color: var(--color-cta);
  box-shadow: 0 4px 14px rgba(176, 122, 140, 0.30);
}
.btn-primary:hover {
  background: var(--purple-700);
  border-color: var(--purple-700);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(176, 122, 140, 0.40);
}

.btn-secondary {
  background: transparent;
  color: var(--purple-500);   /* Sage */
  border-color: var(--purple-500);
}
.btn-secondary:hover {
  background: var(--orange-50);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--grey-700);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--grey-100);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: var(--font-size-lg);
}

.btn-full { width: 100%; }

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.card-elevated {
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

/* ============================================================
   Form Elements
   ============================================================ */

.form-group { display: flex; flex-direction: column; gap: var(--space-2); }

.form-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--grey-700);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(176, 122, 140, 0.12);
}

.form-input.error,
.form-select.error { border-color: #EF4444; }

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--grey-500);
}

.form-error {
  font-size: var(--font-size-xs);
  color: #EF4444;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-20) 0;
}

.section-sm {
  padding: var(--space-12) 0;
}

.section-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-brand);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  color: var(--grey-900);
  line-height: 1.15;
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--font-size-lg);
  color: var(--grey-600);
  line-height: 1.6;
  max-width: 600px;
}

/* ============================================================
   Badges
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
}

.badge-purple {
  background: var(--purple-100);
  color: var(--purple-700);
}

.badge-orange {
  background: var(--orange-100);
  color: var(--orange-600);
}

.badge-green {
  background: #D1FAE5;
  color: #065F46;
}

.badge-red {
  background: #FEE2E2;
  color: #991B1B;
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  background: var(--grey-900);
  color: var(--grey-400);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer-brand .footer-logo {
  margin-bottom: var(--space-4);
}

.footer-brand p {
  font-size: var(--font-size-sm);
  line-height: 1.7;
  max-width: 280px;
}

.footer-col h4 {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--white);
  margin-bottom: var(--space-4);
}

.footer-col ul { display: flex; flex-direction: column; gap: var(--space-2); }

.footer-col a {
  font-size: var(--font-size-sm);
  color: var(--grey-400);
  transition: color var(--transition-fast);
}
.footer-col a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer-disclaimer {
  font-size: var(--font-size-xs);
  color: var(--grey-500);
  max-width: 700px;
  line-height: 1.7;
}

/* ============================================================
   Modal
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;       /* centre modal vertically within the viewport */
  justify-content: center;
  padding: var(--space-6);
  /* overflow:hidden — the overlay must NOT be a scroll container.
     If the overlay itself can scroll, wheel events that land on the overlay
     behind/below the modal box scroll the overlay (i.e. the page) instead
     of the modal. Each modal-inner uses display:flex + flex-direction:column
     + max-height:90vh so its own body child handles scrolling internally. */
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

/* body.modal-open intentionally removed:
   overflow:hidden on <body> propagates to the viewport and blocks scroll
   on position:fixed modal overlays. .dash-main is locked directly instead. */

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  transform: translateY(16px);
  transition: transform var(--transition-slow);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--grey-900);
  margin-bottom: var(--space-3);
}

.modal-body {
  font-size: var(--font-size-sm);
  color: var(--grey-600);
  line-height: 1.7;
  margin-bottom: var(--space-6);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

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

#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 360px;
}

.toast {
  background: var(--grey-900);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  font-size: var(--font-size-sm);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  animation: toastIn 0.3s ease forwards;
}

.toast.toast-success { border-left: 4px solid #10B981; }
.toast.toast-error   { border-left: 4px solid #EF4444; }
.toast.toast-info    { border-left: 4px solid var(--color-brand); }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================================
   Utilities
   ============================================================ */

.text-center { text-align: center; }
.text-muted  { color: var(--grey-500); }
.text-brand  { color: var(--color-brand); }
.text-cta    { color: var(--color-cta); }

.gradient-text {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

/* ============================================================
   Mobile Nav Toggle
   ============================================================ */

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--grey-700);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

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

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 768px) {
  :root { --nav-height: 64px; }

  .nav-inner {
    padding: 0 var(--space-4);
    gap: var(--space-2);
  }

  .nav-logo img,
  .nav-logo svg {
    height: 48px;
    max-width: 180px;
    object-fit: contain;
  }

  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  /* Hide the nav CTA button on mobile — hamburger menu is sufficient */
  .nav-cta .btn { display: none; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) var(--space-6);
    gap: var(--space-4);
    box-shadow: var(--shadow-lg);
    z-index: 99;
  }

  .section-title { font-size: var(--font-size-3xl); }
  .section { padding: var(--space-16) 0; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }

  /* Modal: reduce padding and ensure it can scroll on narrow screens */
  .modal {
    padding: var(--space-6);
    border-radius: var(--radius-xl);
  }
  .modal-overlay {
    padding: var(--space-4);
  }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }
  .section-title { font-size: var(--font-size-2xl); }
  .section { padding: var(--space-10) 0; }
  .section-sm { padding: var(--space-8) 0; }
}

/* Toast: prevent overflow on very narrow screens */
@media (max-width: 430px) {
  #toast-container {
    right: var(--space-3);
    left: var(--space-3);
    max-width: none;
  }
}
