@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
    --bg: #fff8ff;
    --bg-soft: rgba(255, 255, 255, 0.72);
    --surface: rgba(255, 255, 255, 0.84);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --text: #2a1638;
    --text-soft: #6f577f;
    --line: rgba(122, 62, 177, 0.14);
    --pink: #ff6db2;
    --pink-soft: #ffd0e5;
    --purple: #7a3eb1;
    --purple-deep: #4e2472;
    --mauve: #b78ef3;
    --rose: #ff8bc7;
    --mint: #c8f7e0;
    --shadow: 0 24px 70px rgba(99, 38, 128, 0.14);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 175, 216, 0.34), transparent 26%),
        radial-gradient(circle at top right, rgba(162, 122, 255, 0.22), transparent 22%),
        linear-gradient(180deg, #fff7fd 0%, #fffdfd 48%, #fff4fb 100%);
}

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

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

textarea {
    resize: vertical;
}

.ambient {
    position: fixed;
    inset: auto;
    width: 18rem;
    height: 18rem;
    border-radius: 999px;
    filter: blur(26px);
    opacity: 0.5;
    pointer-events: none;
}

.ambient-one {
    top: -4rem;
    left: -3rem;
    background: rgba(255, 132, 188, 0.32);
}

.ambient-two {
    right: -3rem;
    top: 18rem;
    background: rgba(121, 65, 175, 0.18);
}

.page-shell {
    position: relative;
    width: min(1120px, calc(100% - 1.4rem));
    margin: 0 auto;
    padding: 1rem 0 6rem;
}

.topbar {
    position: sticky;
    top: 0.75rem;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 250, 255, 0.78);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.brandmark {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.brandmark-mark {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    box-shadow: 0 0 0 8px rgba(255, 122, 179, 0.15);
}

.brandmark strong,
.hero h1,
.panel-card h2,
.panel-card h3,
.auth-card h1 {
    font-family: "Fraunces", serif;
}

.brandmark small,
.panel-label,
.eyebrow,
.metric-chip span,
.stat-card span,
.insight-pill span,
.calendar-meta,
.field-help,
.muted-text {
    color: var(--text-soft);
}

.brandmark span {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.main-content {
    display: grid;
    gap: 1rem;
}

.flash {
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    backdrop-filter: blur(12px);
}

.flash-success {
    border-color: rgba(88, 169, 126, 0.25);
    background: rgba(240, 255, 247, 0.86);
}

.flash-error {
    border-color: rgba(217, 86, 115, 0.28);
    background: rgba(255, 238, 244, 0.88);
}

.hero,
.panel-card,
.auth-card,
.feature-card,
.stat-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.hero {
    display: grid;
    gap: 1.25rem;
    padding: 1.35rem;
    overflow: hidden;
}

.hero-landing {
    background-image:
        linear-gradient(135deg, rgba(255, 109, 178, 0.8) 0%, rgba(122, 62, 177, 0.9) 100%),
        url('/assets/images/ele.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 4px solid #FFF;
}

.hero-landing .feature-card,
.hero-landing .panel-card,
.hero-landing .stat-card,
.hero-landing .auth-card {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: 0 20px 48px rgba(78, 36, 114, 0.16);
}

.hero-app {
    background:
        linear-gradient(145deg, rgba(255, 227, 241, 0.96) 0%, rgba(255, 250, 255, 0.96) 60%, rgba(238, 229, 255, 0.96) 100%);
}

.hero-copy {
    display: grid;
    gap: 0.55rem;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 0.98;
}

.hero-text {
    margin: 0;
    max-width: 54rem;
    font-size: 1rem;
    line-height: 1.65;
}

.hero-actions,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.feature-stack,
.dashboard-grid,
.detail-grid,
.stats-grid {
    display: grid;
    gap: 1rem;
}

.feature-card,
.panel-card,
.stat-card,
.auth-card {
    padding: 1.2rem;
}

.landing-grid,
.stats-grid,
.detail-grid {
    grid-template-columns: 1fr;
}

.panel-span-two {
    grid-column: span 1;
}

.panel-label,
.eyebrow {
    margin: 0;
    font-size: 0.76rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    color: #FFF;
}

.panel-card h2,
.panel-card h3,
.feature-card h2,
.auth-card h1 {
    margin: 0.2rem 0 0.5rem;
}

.stacked-copy {
    display: grid;
    gap: 0.35rem;
}

.stacked-copy p,
.feature-card p,
.panel-card p,
.auth-footer {
    margin: 0;
    line-height: 1.6;
}

.subheader {
    color: #FFF;
    font-weight: bolder;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.95rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(122, 62, 177, 0.15);
    border-radius: 30px;
    font-weight: 700;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    border: 2px solid #FFF;
}

.btn-secondary {
    color: var(--purple-deep);
    background: linear-gradient(135deg, rgba(255, 222, 238, 0.96) 0%, rgba(238, 226, 255, 0.96) 100%);
}

.btn-ghost {
    color: var(--purple-deep);
    border-color: rgba(122, 62, 177, 0.16);
    background: rgba(255, 255, 255, 0.62);
}

.btn-block {
    width: 100%;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 11rem);
}

.auth-card {
    width: min(100%, 32rem);
    display: grid;
    gap: 1rem;
}

.form-stack,
.field-grid,
.score-grid {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.55rem;
}

.field span,
.score-group legend {
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(122, 62, 177, 0.14);
    border-radius: var(--radius-sm);
    background: var(--surface-strong);
    color: var(--text);
}

.field textarea {
    min-height: 7rem;
}

.score-group {
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    gap: 0.6rem;
}

.score-options,
.chip-selector,
.toggle-row,
.insight-strip,
.metric-grid,
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.score-pill,
.choice-chip,
.toggle-card,
.metric-chip,
.chip,
.insight-pill {
    position: relative;
    border-radius: 999px;
    border: 1px solid rgba(122, 62, 177, 0.15);
    background: rgba(255, 255, 255, 0.88);
}

.score-pill input,
.choice-chip input,
.toggle-card input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.score-pill span,
.choice-chip span,
.toggle-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.75rem 1rem;
    font-weight: 700;
}

.score-pill input:checked + span,
.choice-chip input:checked + span,
.toggle-card input:checked + span {
    color: white;
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    border-radius: 999px;
}

.foldout summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
}

.foldout summary::-webkit-details-marker {
    display: none;
}

.foldout[open] summary {
    margin-bottom: 1rem;
}

.section-headline,
.panel-headline,
.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.insight-pill,
.metric-chip {
    display: grid;
    gap: 0.2rem;
    padding: 0.8rem 0.95rem;
    min-width: 9rem;
}

.metric-chip strong,
.insight-pill strong,
.stat-card strong {
    font-size: 1.05rem;
}

.stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}

.calendar-weekdays {
    margin-top: 1.2rem;
}

.calendar-weekdays span {
    font-size: 0.8rem;
    text-align: center;
    color: var(--text-soft);
}

.calendar-cell {
    display: grid;
    align-content: space-between;
    min-height: 6.5rem;
    padding: 0.75rem;
    border: 1px solid rgba(122, 62, 177, 0.1);
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.78);
    transition: transform 140ms ease, border-color 140ms ease;
}

.calendar-cell:hover {
    transform: translateY(-1px);
}

.calendar-number {
    font-weight: 800;
}

.calendar-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 132, 188, 0.14);
    color: var(--purple-deep);
    font-size: 0.72rem;
    font-weight: 700;
}

.tone-bright {
    background: linear-gradient(180deg, rgba(255, 240, 248, 0.96) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.tone-steady {
    background: linear-gradient(180deg, rgba(245, 238, 255, 0.96) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.tone-low {
    background: linear-gradient(180deg, rgba(249, 240, 247, 0.96) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.tone-cycle {
    background: linear-gradient(180deg, rgba(255, 223, 236, 0.96) 0%, rgba(255, 250, 252, 0.9) 100%);
}

.is-selected {
    border-color: rgba(255, 109, 178, 0.78);
    box-shadow: 0 0 0 3px rgba(255, 109, 178, 0.14);
}

.is-outside {
    opacity: 0.52;
}

.timeline-list {
    display: grid;
    gap: 0.75rem;
}

.timeline-item {
    display: grid;
    gap: 0.18rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(122, 62, 177, 0.12);
}

.note-copy {
    line-height: 1.7;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0.85rem;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    width: min(36rem, calc(100% - 1.4rem));
    padding: 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(122, 62, 177, 0.12);
    background: rgba(255, 250, 255, 0.88);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.bottom-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.85rem;
    border-radius: 999px;
    font-weight: 700;
}

.bottom-nav-link-primary {
    color: white;
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
}

@media (min-width: 720px) {
    .page-shell {
        width: min(1180px, calc(100% - 2.4rem));
        padding-bottom: 7rem;
    }

    .landing-grid,
    .detail-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .field-grid,
    .score-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .panel-span-two {
        grid-column: span 2;
    }

    .hero {
        grid-template-columns: 1.4fr 0.9fr;
        align-items: end;
    }

    .calendar-cell {
        min-height: 7.8rem;
    }
}

@media (max-width: 719px) {
    .topbar {
        border-radius: 1.2rem;
        padding: 0.85rem;
    }

    .topbar,
    .hero-actions,
    .action-row,
    .section-headline,
    .calendar-toolbar,
    .panel-headline {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-actions {
        width: 100%;
        justify-content: stretch;
    }

    .topbar-actions .btn,
    .hero-actions .btn,
    .action-row .btn,
    .section-headline .btn {
        width: 100%;
    }

    .calendar-cell {
        min-height: 5.8rem;
        padding: 0.55rem;
    }

    .calendar-meta,
    .calendar-pill {
        font-size: 0.66rem;
    }
}
