﻿:root {
    --nx-bg: #fcf8ff;
    --nx-surface: rgba(255, 255, 255, .80);
    --nx-surface-solid: #ffffff;
    --nx-container: #f0ecf9;
    --nx-text: #1b1b24;
    --nx-muted: #464555;
    --nx-outline: #c7c4d8;
    --nx-primary: #3525cd;
    --nx-health: #4db6ac;
    --nx-finance: #059669;
    --nx-wardrobe: #fb7185;
    --nx-shadow: 0 10px 30px rgba(53, 37, 205, .06);
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

html,
body {
    background: radial-gradient(120% 120% at 50% -10%, #ebe5fb 0%, var(--nx-bg) 48%);
    color: var(--nx-text);
    font-family: Manrope, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    min-height: 100%;
}

body {
    line-height: 1.36;
}

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

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.08;
}

h2 {
    font-size: 1.04rem;
    font-weight: 760;
}

h3 {
    font-size: .96rem;
    font-weight: 740;
}

button,
input,
textarea {
    font: inherit;
}

.nexo-page {
    min-height: 100dvh;
}

.nexo-topbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    left: 50%;
    max-width: 880px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    position: fixed;
    top: 0;
    transform: translateX(-50%);
    width: calc(100% - 16px);
    z-index: 90;
}

.brand {
    align-items: center;
    display: inline-flex;
    font-size: 1.02rem;
    font-weight: 800;
    gap: 8px;
}

.brand-dot {
    background: linear-gradient(145deg, #5e51e7 0%, var(--nx-primary) 100%);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(53, 37, 205, .35);
    display: inline-block;
    height: 10px;
    width: 10px;
}

.topbar-actions {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.topbar-icon,
.topbar-avatar {
    align-items: center;
    background: var(--nx-surface-solid);
    border: 1px solid var(--nx-outline);
    border-radius: 999px;
    color: var(--nx-muted);
    display: inline-flex;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.topbar-avatar {
    background: linear-gradient(145deg, #efedff 0%, #fff 100%);
    color: var(--nx-primary);
}

.content {
    margin: 0 auto;
    max-width: 860px;
    width: 100%;
}

.shell-content {
    padding: calc(88px + env(safe-area-inset-top)) 12px calc(90px + env(safe-area-inset-bottom));
}

.safe-bottom {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.page-header {
    margin-bottom: 14px;
}

.eyebrow {
    color: var(--nx-muted);
    font-size: .74rem;
    font-weight: 760;
    letter-spacing: .06em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.page-subtitle {
    color: var(--nx-muted);
    font-size: .9rem;
    margin-top: 8px;
}

.glass-card {
    backdrop-filter: blur(12px);
    background: var(--nx-surface);
    border: 1px solid rgba(255, 255, 255, .62);
    border-radius: 18px;
    box-shadow: var(--nx-shadow);
}

.section-card {
    margin-top: 14px;
    padding: 14px;
}

.bento-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.bento-main {
    padding: 14px;
}

.metric-strip {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.metric-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    margin-top: 12px;
}

.metric-card {
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 11px;
}

.metric-card span {
    color: var(--nx-muted);
    display: block;
    font-size: .74rem;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    font-size: 1rem;
    margin-top: 4px;
}

.metric-card small {
    color: var(--nx-muted);
    display: block;
    font-size: .75rem;
    margin-top: 3px;
}

.module-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.module-card {
    border: 1px solid transparent;
    display: grid;
    gap: 8px;
    padding: 14px;
}

.module-card-head,
.section-header,
.card-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.module-card p,
.empty,
.notice,
.history-row span,
.history-row small {
    color: var(--nx-muted);
}

.module-icon-wrap {
    align-items: center;
    background: rgba(255, 255, 255, .72);
    border-radius: 999px;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.module-toggle {
    background: var(--nx-surface-solid);
    border: 1px solid var(--nx-outline);
    border-radius: 12px;
    color: var(--nx-text);
    font-size: .88rem;
    font-weight: 700;
    min-height: 42px;
    padding: 10px 12px;
}

.pill {
    background: rgba(53, 37, 205, .10);
    border: 1px solid rgba(53, 37, 205, .18);
    border-radius: 999px;
    color: var(--nx-primary);
    display: inline-flex;
    font-size: .72rem;
    font-weight: 760;
    padding: 4px 10px;
}

.pill-on {
    background: rgba(16, 185, 129, .11);
    border-color: rgba(16, 185, 129, .26);
    color: #047857;
}

.pill-off {
    background: rgba(113, 113, 122, .11);
    border-color: rgba(113, 113, 122, .26);
    color: #52525b;
}

.primary-action {
    align-items: center;
    background: linear-gradient(145deg, #4738dd 0%, var(--nx-primary) 100%);
    border: 0;
    border-radius: 14px;
    color: #fff;
    display: inline-flex;
    font-size: .9rem;
    font-weight: 760;
    gap: 7px;
    justify-content: center;
    min-height: 46px;
    padding: 10px 14px;
    text-decoration: none;
}

.text-link {
    color: var(--nx-primary);
    font-size: .88rem;
    font-weight: 760;
}

.module-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.module-chip {
    background: #fff;
    border: 1px solid var(--nx-outline);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    padding: 6px 10px;
}

.weight-hero {
    margin-top: 2px;
    padding: 16px;
}

.weight-main {
    align-items: baseline;
    display: flex;
    gap: 6px;
}

.weight-main strong {
    font-size: 2rem;
    font-weight: 820;
    line-height: 1;
}

.weight-main span {
    color: var(--nx-muted);
    font-size: 1rem;
    font-weight: 700;
}

.trend-text {
    color: var(--nx-muted);
    font-size: .86rem;
    margin-top: 8px;
}

.form-card {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 14px;
}

.form-card label {
    color: var(--nx-muted);
    display: grid;
    font-size: .84rem;
    font-weight: 700;
    gap: 6px;
}

.form-card input,
.form-card textarea {
    background: #fff;
    border: 1px solid var(--nx-outline);
    border-radius: 11px;
    color: var(--nx-text);
    min-height: 44px;
    padding: 10px 12px;
}

.form-card textarea {
    min-height: 86px;
}

.weight-stepper {
    display: grid;
    gap: 8px;
}

.weight-stepper-title {
    color: var(--nx-muted);
    font-size: .84rem;
    font-weight: 760;
}

.weight-stepper-empty {
    color: var(--nx-muted);
    font-size: .82rem;
}

.weight-stepper-control {
    align-items: center;
    background: rgba(255, 255, 255, .58);
    border: 1px solid rgba(255, 255, 255, .76);
    border-radius: 16px;
    display: grid;
    gap: 8px;
    grid-template-columns: 52px minmax(0, 1fr) auto 52px;
    min-height: 76px;
    padding: 10px;
}

.weight-stepper-button {
    align-items: center;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, .84);
    border: 1px solid rgba(199, 196, 216, .86);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(14, 16, 28, .08);
    color: var(--nx-text);
    display: inline-flex;
    font-size: 1.35rem;
    font-weight: 820;
    height: 52px;
    justify-content: center;
    min-height: 48px;
    min-width: 48px;
    padding: 0;
    transition: transform .12s ease, opacity .12s ease;
    width: 52px;
}

.weight-stepper-button:active {
    transform: scale(.95);
}

.weight-stepper-button:disabled {
    opacity: .42;
}

.weight-stepper-value {
    color: var(--nx-text);
    font-size: clamp(2rem, 12vw, 3.4rem);
    font-weight: 840;
    justify-self: end;
    line-height: 1;
}

.weight-stepper-unit {
    color: var(--nx-muted);
    font-size: 1rem;
    font-weight: 760;
    justify-self: start;
}

.form-card > button {
    background: var(--nx-health);
    border: 0;
    border-radius: 12px;
    color: #083344;
    font-weight: 760;
    min-height: 44px;
}

.chart-wrap {
    margin-top: 10px;
    width: 100%;
}

.weight-chart {
    background: linear-gradient(180deg, rgba(53, 37, 205, .07) 0%, rgba(53, 37, 205, 0) 100%);
    border: 1px solid rgba(53, 37, 205, .1);
    border-radius: 12px;
    display: block;
    height: 140px;
    width: 100%;
}

.history-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.history-row {
    align-items: center;
    background: rgba(255, 255, 255, .7);
    border: 1px solid var(--nx-outline);
    border-radius: 12px;
    display: grid;
    gap: 6px;
    grid-template-columns: 1fr auto;
    padding: 11px;
}

.history-row strong {
    font-size: .9rem;
}

.history-row small {
    display: block;
    font-size: .75rem;
    margin-top: 2px;
}

.nexo-icon {
    height: 18px;
    width: 18px;
}

.tone-health {
    border-color: rgba(77, 182, 172, .35);
}

.tone-finance {
    border-color: rgba(5, 150, 105, .33);
}

.tone-wardrobe {
    border-color: rgba(251, 113, 133, .32);
}

.tone-indigo {
    border-color: rgba(53, 37, 205, .22);
}

.bottom-nav {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, .88);
    border-top: 1px solid var(--nx-outline);
    bottom: 0;
    box-shadow: 0 -8px 24px rgba(14, 16, 28, .07);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    left: 0;
    min-height: 70px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    z-index: 85;
}

.nav-link {
    align-items: center;
    border-radius: 10px;
    color: var(--nx-muted);
    display: grid;
    font-size: .75rem;
    font-weight: 730;
    gap: 4px;
    justify-items: center;
    min-height: 46px;
    padding: 4px;
}

.nav-link.active {
    background: rgba(53, 37, 205, .1);
    color: var(--nx-primary);
}

.notice,
.empty {
    font-size: .9rem;
    padding: 8px 2px;
}

.validation-message,
.validation-summary-errors,
.text-danger {
    color: var(--danger);
}

.auth-page,
.account-page {
    display: grid;
    gap: 14px;
}

.auth-grid,
.account-grid {
    display: grid;
    gap: 10px;
}

.auth-panel,
.account-card {
    background: var(--nx-surface);
    border: 1px solid var(--nx-outline);
    border-radius: 16px;
    padding: 14px;
}

.auth-panel .btn-primary {
    background: var(--nx-primary);
    border-color: var(--nx-primary);
}

.account-nav .nav {
    gap: 6px;
}

.account-nav .nav-link {
    border: 1px solid var(--nx-outline);
    border-radius: 10px;
    color: var(--nx-text);
    margin: 0;
    padding: 10px 12px;
}

.account-nav .nav-link.active {
    background: rgba(53, 37, 205, .12);
    border-color: rgba(53, 37, 205, .22);
    color: var(--nx-primary);
}

#blazor-error-ui {
    background: #fff7ed;
    border-top: 1px solid #fed7aa;
    bottom: calc(78px + env(safe-area-inset-bottom));
    display: none;
    left: 0;
    padding: 12px 16px;
    position: fixed;
    right: 0;
    z-index: 1000;
}

@media (min-width: 500px) {
    .shell-content {
        padding-left: 16px;
        padding-right: 16px;
    }

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

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

    .bento-main {
        grid-column: span 2;
    }
}

@media (min-width: 760px) {
    .metric-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .auth-grid,
    .account-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .account-grid {
        grid-template-columns: minmax(210px, .9fr) minmax(0, 2.1fr);
    }
}

@media (min-width: 980px) {
    .shell-content {
        padding-top: 108px;
    }

    .bottom-nav {
        border: 1px solid var(--nx-outline);
        border-radius: 16px;
        bottom: 18px;
        left: 50%;
        max-width: 520px;
        right: auto;
        transform: translateX(-50%);
        width: calc(100% - 32px);
    }
}
