/* ---------- Fonts (hosted locally, SIL Open Font License) ---------- */
@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-display: swap;
    font-weight: 200 1000;
    src: url("fonts/nunito-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-display: swap;
    font-weight: 200 1000;
    src: url("fonts/nunito-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Cairo";
    font-style: normal;
    font-display: swap;
    font-weight: 200 1000;
    src: url("fonts/cairo-arabic.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* Other fonts a nursery can choose (Nursery settings → Branding). The browser only downloads the one in use. */
@font-face { font-family: "Quicksand"; font-style: normal; font-display: swap; font-weight: 300 700; src: url("fonts/quicksand-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Quicksand"; font-style: normal; font-display: swap; font-weight: 300 700; src: url("fonts/quicksand-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Open Sans"; font-style: normal; font-display: swap; font-weight: 300 800; src: url("fonts/opensans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Open Sans"; font-style: normal; font-display: swap; font-weight: 300 800; src: url("fonts/opensans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Montserrat"; font-style: normal; font-display: swap; font-weight: 300 900; src: url("fonts/montserrat-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-style: normal; font-display: swap; font-weight: 300 900; src: url("fonts/montserrat-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Brand ----------
   --brand, --brand-dark and --sun (with their -rgb triplets) are overridden per nursery by the
   <style> block App.razor writes from Nursery settings → Branding (see Services/BrandTheme.cs).
   Every tint below is derived from them, so never hard-code a brand shade elsewhere. */
:root {
    --brand: #6c4ab6;
    --brand-rgb: 108, 74, 182;
    --brand-dark: #4e3583;
    --brand-dark-rgb: 78, 53, 131;
    --sun: #ffb703;
    --sun-rgb: 255, 183, 3;
    --brand-soft: color-mix(in srgb, var(--brand) 10%, #fff);
    --brand-line: color-mix(in srgb, var(--brand) 8%, #fff);
    --brand-light: color-mix(in srgb, var(--brand) 75%, #fff);
    --brand-muted: color-mix(in srgb, var(--brand) 30%, #5a5a66);
    --coral: #ff7b6b;
    --mint: #2ec4b6;
    --sky: #4cc9f0;
    --cream: #fff8f0;
    --ink: #2b2440;
    --shadow: 0 6px 24px rgba(var(--brand-dark-rgb), 0.08);

    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: var(--brand-rgb);
    --bs-link-hover-color: var(--brand-dark);
    --bs-link-hover-color-rgb: var(--brand-dark-rgb);
    --bs-body-color: var(--ink);
    --bs-border-radius: 0.75rem;
    --bs-border-radius-sm: 0.5rem;
    --bs-border-radius-lg: 1rem;
    --brand-font: "Nunito";
    --bs-body-font-family: var(--brand-font), "Cairo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

html, body {
    font-family: var(--bs-body-font-family);
}

body {
    background-color: var(--cream);
}

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5, .display-6 {
    font-weight: 800;
    color: var(--ink);
}

/* Nothing may widen the page sideways (matters most in right-to-left layouts). */
body {
    overflow-x: clip; /* "clip", not "hidden", so sticky headers keep working */
}

a, .btn-link {
    color: var(--brand);
}

/* ---------- Buttons ---------- */
.btn {
    font-weight: 700;
    border-radius: 999px;
    padding-inline: 1.1rem;
}

.btn-sm {
    padding-inline: 0.6rem;
}

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    box-shadow: 0 4px 14px rgba(var(--brand-rgb), 0.3);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand);
}

.btn-sun {
    background: var(--sun);
    color: var(--ink);
    border: none;
    box-shadow: 0 4px 14px rgba(var(--sun-rgb), 0.35);
}

    .btn-sun:hover {
        background: color-mix(in srgb, var(--sun) 88%, #000);
        color: var(--ink);
    }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(var(--brand-rgb), 0.45);
}

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-radius: 0.65rem;
    border-color: color-mix(in srgb, var(--brand) 16%, #fff);
}

    .form-control:focus, .form-select:focus {
        border-color: var(--brand);
    }

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

/* ---------- Cards, tables, tabs, badges ---------- */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--brand-line);
    font-weight: 800;
    padding-top: 0.9rem;
}

.content .table {
    --bs-table-bg: #fff;
    --bs-table-hover-bg: var(--brand-soft);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

    .content .table > thead th {
        background: color-mix(in srgb, var(--brand) 5%, #fff);
        color: var(--brand-muted);
        font-size: 0.78rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        border-bottom: none;
        padding-top: 0.8rem;
        padding-bottom: 0.8rem;
    }

    .content .table > tbody td {
        border-color: var(--brand-line);
    }

.badge {
    border-radius: 999px;
    font-weight: 700;
    padding: 0.4em 0.75em;
}

.nav-tabs {
    border-bottom: 2px solid color-mix(in srgb, var(--brand) 12%, #fff);
    gap: 0.25rem;
}

    .nav-tabs .nav-link {
        border: none;
        border-bottom: 3px solid transparent;
        color: var(--brand-muted);
        font-weight: 700;
        margin-bottom: -2px;
    }

        .nav-tabs .nav-link.active {
            color: var(--brand);
            background: transparent;
            border-bottom-color: var(--brand);
        }

.nav-pills .nav-link.active {
    background-color: var(--brand);
}

.list-group-item-action:hover {
    background: var(--brand-soft);
}

.content {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

h1:focus {
    outline: none;
}

/* Arrows that point "back"/"forward" must mirror in right-to-left languages. */
[dir="rtl"] .flip-rtl {
    display: inline-block;
    transform: scaleX(-1);
}

/* ---------- Phones and small tablets ---------- */
/* Title rows (heading + buttons) wrap instead of squeezing the heading. */
.content > .d-flex.justify-content-between,
.content .page-header {
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 767.98px) {
    /* Wide tables scroll sideways inside their own box instead of widening the page. */
    .content .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

        .content .table th, .content .table td {
            white-space: nowrap;
        }

    /* Tabs scroll sideways in one line. */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

        .nav-tabs .nav-link {
            white-space: nowrap;
        }

    article.content {
        padding-inline: 1rem !important;
        padding-top: 1rem;
    }

    .welcome-banner {
        padding: 1.5rem !important;
    }

    .hero {
        padding: 2.5rem 0 3rem;
    }

    .section {
        padding: 2.75rem 0;
    }

    .display-6 {
        font-size: 1.65rem;
    }

    .price {
        font-size: 1.75rem;
    }

    h1.h3, .h3 {
        font-size: 1.4rem;
    }
}

/* ---------- Printing (invoices, end-of-day report): browser "Print" or "Save as PDF" ---------- */
@media print {
    .sidebar, .top-row, .no-print, #blazor-error-ui, .btn {
        display: none !important;
    }

    body, main, article.content {
        background: #fff !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .card, .content .table {
        box-shadow: none !important;
    }

    .page {
        display: block !important;
    }

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

/* Error bar shown by Blazor only when something fails; global so every layout hides it by default. */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        inset-inline-end: 0.75rem;
        top: 0.5rem;
    }

/* ---------- Validation ---------- */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #d63a2f;
    font-size: 0.875rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5I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I2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Floating-label fields: the label already says what to type, so hide the example text. */
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: transparent;
}

/* ---------- Dashboard ---------- */
.stat-card {
    border-radius: 1.1rem;
    color: #fff;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .stat-card:hover {
        transform: translateY(-3px);
        color: #fff;
        box-shadow: 0 10px 28px rgba(43, 36, 64, 0.18);
    }

    .stat-card .stat-icon {
        width: 3rem;
        height: 3rem;
        border-radius: 0.9rem;
        background: rgba(255, 255, 255, 0.22);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
    }

.bg-brand { background: linear-gradient(135deg, var(--brand-light), var(--brand-dark)); }
.bg-coral { background: linear-gradient(135deg, #ff9a8b, #ff6a5a); }
.bg-mint { background: linear-gradient(135deg, #49d8c9, #1fa596); }
.bg-sun { background: linear-gradient(135deg, color-mix(in srgb, var(--sun) 80%, #fff), color-mix(in srgb, var(--sun) 85%, #f60)); }

.welcome-banner {
    background: linear-gradient(120deg, var(--brand) 0%, var(--brand-light) 60%, color-mix(in srgb, var(--brand) 55%, #fff) 100%);
    color: #fff;
    border-radius: 1.25rem;
    position: relative;
    overflow: hidden;
}

    .welcome-banner h1 {
        color: #fff;
    }

    .welcome-banner::after {
        content: "";
        position: absolute;
        width: 220px;
        height: 220px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.12);
        inset-inline-end: -60px;
        top: -80px;
    }

/* ---------- Public site ---------- */
.public-nav {
    background: rgba(255, 248, 240, 0.92);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #f1e6d8;
}

.brand-mark {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.8rem;
    background: var(--sun);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 4.5rem 0 5rem;
    isolation: isolate;
}

    .hero h1 {
        font-size: clamp(2.2rem, 5vw, 3.6rem);
        line-height: 1.1;
    }

    .hero .lead {
        color: #5d5574;
        font-size: 1.2rem;
    }

.hero-blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    z-index: -1;
}

.hero-art {
    position: relative;
    aspect-ratio: 1;
    max-width: 440px;
    margin-inline: auto;
}

    .hero-art .bubble {
        position: absolute;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        box-shadow: 0 14px 40px rgba(43, 36, 64, 0.18);
        animation: float 6s ease-in-out infinite;
    }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-art .bubble { animation: none; }
}

.section {
    padding: 4rem 0;
}

.section-alt {
    background: #fff;
}

.section-eyebrow {
    color: var(--coral);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
}

.feature-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.price {
    font-size: 2rem;
    font-weight: 900;
    color: var(--brand);
}

.public-footer {
    background: var(--ink);
    color: #d9d3ea;
}

    .public-footer a {
        color: #fff;
    }

    .public-footer h2, .public-footer h3 {
        color: #fff;
    }

.auth-panel {
    background: linear-gradient(150deg, var(--brand) 0%, var(--brand-light) 55%, var(--coral) 130%);
    color: #fff;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

    .auth-panel h2 {
        color: #fff;
    }

    .auth-panel::before {
        content: "";
        position: absolute;
        width: 260px;
        height: 260px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.14);
        bottom: -90px;
        inset-inline-start: -70px;
        z-index: -1;
    }

/* Demo database flag (Views/Shared/_DemoBanner.cshtml): on every page while an @demo account is used. */
.demo-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .25rem .5rem;
    padding: .4rem 1rem;
    background: repeating-linear-gradient(-45deg, #ffd23f, #ffd23f 14px, #ffc61a 14px, #ffc61a 28px);
    color: #3a2a00;
    font-size: .9rem;
    text-align: center;
    border-bottom: 2px solid #c99700;
}
.demo-banner strong {
    letter-spacing: .08em;
    background: #3a2a00;
    color: #ffd23f;
    padding: .05rem .5rem;
    border-radius: .3rem;
}
