@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Figtree:wght@300;400;500;600;700&display=swap');

:root {
    /* ── Earth & Bloom: Base Palette ── */
    --bg-primary: #FAF8F5;
    --bg-secondary: #F2EFEB;
    --bg-elevated: #FFFFFF;
    --text-primary: #2D2A26;
    --text-secondary: #6B705C;
    --text-muted: #9A9A8E;
    --border-color: #E8E4DF;
    --border-light: #F0ECE8;

    /* ── Peach Zone: Chu kỳ kinh nguyệt ── */
    --peach-500: #E07A5F;
    --peach-400: #E8927A;
    --peach-300: #F4A261;
    --peach-200: #FCDCC8;
    --peach-100: #FFF0E6;
    --peach-glow: rgba(224, 122, 95, 0.12);

    /* ── Sage Zone: Thai kỳ ── */
    --sage-500: #81B29A;
    --sage-400: #95C4AD;
    --sage-300: #A8E6CF;
    --sage-200: #D4EFE1;
    --sage-100: #EFF9F3;
    --sage-glow: rgba(129, 178, 154, 0.12);

    /* ── Blue Zone: Sau sinh ── */
    --blue-500: #7BA7BC;
    --blue-400: #92BAC9;
    --blue-300: #B8C5D6;
    --blue-200: #D6E4ED;
    --blue-100: #EDF3F7;
    --blue-glow: rgba(123, 167, 188, 0.12);

    /* ── System Colors ── */
    --success: #6BBF7A;
    --warning: #F4A261;
    --danger: #E07A5F;
    --info: #7BA7BC;
    --gold: #D4A853;
    --gold-glow: rgba(212, 168, 83, 0.18);

    /* ── Typography ── */
    --font-display: 'DM Serif Display', serif;
    --font-body: 'Figtree', sans-serif;

    /* ── Spacing (8pt grid) ── */
    --sp-2: 2px;
    --sp-4: 4px;
    --sp-8: 8px;
    --sp-12: 12px;
    --sp-16: 16px;
    --sp-20: 20px;
    --sp-24: 24px;
    --sp-32: 32px;
    --sp-40: 40px;
    --sp-48: 48px;
    --sp-64: 64px;

    /* ── Radius ── */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* ── Shadows ── */
    --shadow-sm: 0 1px 3px rgba(45, 42, 38, 0.06);
    --shadow-md: 0 4px 12px rgba(45, 42, 38, 0.08);
    --shadow-lg: 0 8px 24px rgba(45, 42, 38, 0.1);
    --shadow-glow: 0 0 20px var(--peach-glow);

    /* ── Transitions ── */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;

    /* ── Active Zone (default: cycle) ── */
    --zone-500: var(--peach-500);
    --zone-400: var(--peach-400);
    --zone-300: var(--peach-300);
    --zone-200: var(--peach-200);
    --zone-100: var(--peach-100);
    --zone-glow: var(--peach-glow);

    /* ── Sidebar ── */
    --sidebar-width: 260px;
    --header-height: 64px;
}

/* ── Zone Overrides ── */
[data-zone="cycle"] {
    --zone-500: var(--peach-500);
    --zone-400: var(--peach-400);
    --zone-300: var(--peach-300);
    --zone-200: var(--peach-200);
    --zone-100: var(--peach-100);
    --zone-glow: var(--peach-glow);
}

[data-zone="pregnancy"] {
    --zone-500: var(--sage-500);
    --zone-400: var(--sage-400);
    --zone-300: var(--sage-300);
    --zone-200: var(--sage-200);
    --zone-100: var(--sage-100);
    --zone-glow: var(--sage-glow);
}

[data-zone="postpartum"] {
    --zone-500: var(--blue-500);
    --zone-400: var(--blue-400);
    --zone-300: var(--blue-300);
    --zone-200: var(--blue-200);
    --zone-100: var(--blue-100);
    --zone-glow: var(--blue-glow);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    min-height: 100vh;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.3;
}

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

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

input,
textarea,
select {
    font-family: var(--font-body);
    font-size: 1rem;
}

/* ── Utility Classes ── */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--sp-24);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration-normal) var(--ease-out),
        transform var(--duration-normal) var(--ease-out);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.card-zone {
    background: var(--zone-100);
    border-color: var(--zone-200);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-8);
    padding: var(--sp-12) var(--sp-24);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--duration-normal) var(--ease-out);
}

.btn-primary {
    background: var(--zone-500);
    color: white;
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--zone-glow);
}

.btn-secondary {
    background: var(--zone-100);
    color: var(--zone-500);
    border: 1px solid var(--zone-200);
}

.btn-secondary:hover {
    background: var(--zone-200);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-12);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--zone-100);
    color: var(--zone-500);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: var(--sp-16);
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ── Organic Shape Decorations ── */
.organic-blob {
    position: absolute;
    border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
    opacity: 0.08;
    pointer-events: none;
    animation: blobFloat 12s ease-in-out infinite;
}

@keyframes blobFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(10px, -15px) scale(1.02);
    }

    66% {
        transform: translate(-8px, 8px) scale(0.98);
    }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ── App Layout ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    transition: margin-left var(--duration-slow) var(--ease-out);
}

.app-content {
    max-width: 1100px;
    padding: var(--sp-32);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .app-main {
        margin-left: 0;
        padding-bottom: 80px;
    }

    .app-content {
        padding: var(--sp-16);
    }
}

/* ── Grid Layouts ── */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-16);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-16);
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ── Animations ── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.animate-fade-in {
    animation: fadeIn var(--duration-slow) var(--ease-out) forwards;
}

.animate-slide-in {
    animation: slideInLeft var(--duration-slow) var(--ease-out) forwards;
}

.animate-scale-in {
    animation: scaleIn var(--duration-normal) var(--ease-bounce) forwards;
}

.validate-error {
    border-color: #ef4444 !important;
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.option-input:checked+.mood-label,
.option-input:checked+.symptom-label {
    background: #dbeafe !important;
    border-color: #3b82f6 !important;
    color: #1e40af !important;
    transform: scale(1.05);
}

.mood-label,
.symptom-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    font-size: 0.9rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}