/* ══════════════════════════════════════════════
   BASE.CSS — global reset + CSS custom properties
   Load this FIRST on every page (auth & admin).
   ══════════════════════════════════════════════ */

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

/* ── DESIGN TOKENS ───────────────────────────── */
:root {
    /* Brand */
    --color-primary: #2E3A4D;
    --color-brand: #3e5272;
    --color-accent: #F97316;
    --color-white: #ffffff;

    /* UI */
    --color-hover-bg: rgba(249, 115, 22, 0.10);
    --border: #e2e8f0;
    --text-muted: #64748b;
    --input-bg: #f8fafc;
    --page-bg: #f8f8f8;

    /* Typography - Font Stack */
    --font-base: 'Inter', 'Roboto', sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --font-reference: var(--font-mono);

    /* Typography - Scale (Typographic Hierarchy) */
    --text-xs: 11px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-md: 15px;
    --text-lg: 16px;
    --text-xl: 18px;
    --text-2xl: 20px;
    --text-3xl: 24px;
    --text-4xl: 28px;
    --text-5xl: 32px;

    /* Font Weights */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-extrabold: 800;

    /* Line Heights */
    --lh-tight: 1.25;
    --lh-normal: 1.5;
    --lh-relaxed: 1.75;
    --lh-loose: 2;

    /* Letter Spacing */
    --ls-tight: -0.01em;
    --ls-normal: 0;
    --ls-wide: 0.025em;
    --ls-wider: 0.05em;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    /* Misc */
    --transition: 0.25s ease;
    --input-height: 46px;
}

/* ── BASE ────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

html,
body {
    height: 100%;
    font-family: var(--font-base);
    font-size: var(--text-base);
    line-height: var(--lh-normal);
    color: var(--color-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--page-bg);
}

/* ─── TYPOGRAPHY HIERARCHY ──────────────────── */
h1 {
    font-size: var(--text-5xl);
    font-weight: var(--fw-extrabold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    margin-bottom: 0.5em;
    color: var(--color-primary);
}

h2 {
    font-size: var(--text-3xl);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    margin-bottom: 0.6em;
    color: var(--color-primary);
}

h3 {
    font-size: var(--text-2xl);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-normal);
    letter-spacing: var(--ls-normal);
    margin-bottom: 0.7em;
    color: var(--color-primary);
}

h4,
h5,
h6 {
    font-size: var(--text-lg);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-normal);
    letter-spacing: var(--ls-normal);
    margin-bottom: 0.75em;
    color: var(--color-primary);
}

p {
    line-height: var(--lh-relaxed);
    margin-bottom: 1em;
}

small,
.text-sm {
    font-size: var(--text-sm);
    line-height: var(--lh-normal);
}

.text-xs {
    font-size: var(--text-xs);
    line-height: var(--lh-normal);
}

.text-muted {
    color: var(--text-muted);
}

.text-bold {
    font-weight: var(--fw-bold);
}

.text-semibold {
    font-weight: var(--fw-semibold);
}

.text-medium {
    font-weight: var(--fw-medium);
}

.text-mono {
    font-family: var(--font-mono);
    font-size: 0.95em;
}

/* Dark mode CSS variable override */
html.admin-dark-mode-active {
    --page-bg: #0f172a;
}

/* Vanny mascot system */
.vanny-mascot {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.vanny-mascot--small {
    width: 64px;
}

.vanny-mascot--medium {
    width: 150px;
}

.vanny-mascot--large {
    width: 260px;
}

.vanny-message-card,
.vanny-alert,
.vanny-empty-state {
    color: var(--u-text, var(--color-primary));
}

.vanny-message-card {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px 18px;
    border: 1px solid var(--u-border, var(--border));
    border-radius: 14px;
    background: var(--u-surface, #fff);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.vanny-message-card__body {
    min-width: 0;
}

.vanny-message-card h3,
.vanny-empty-state h3 {
    margin: 0 0 4px;
    color: inherit;
    font-size: 16px;
    line-height: 1.25;
    letter-spacing: 0;
}

.vanny-message-card p,
.vanny-empty-state p {
    margin: 0;
    color: var(--u-muted, var(--text-muted));
    font-size: 13px;
    line-height: 1.5;
}

.vanny-message-card__action,
.vanny-empty-state__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--color-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.vanny-empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    width: 100%;
    padding: 26px 18px;
    text-align: center;
}

.vanny-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--u-border, var(--border));
    border-radius: 12px;
    background: var(--u-surface2, #f8fafc);
    font-size: 13px;
    line-height: 1.4;
}

.vanny-alert .vanny-mascot {
    width: 40px;
}

.admin-empty-vanny,
.empty-state .admin-empty-vanny,
.schedule-empty .admin-empty-vanny {
    width: 70px;
    margin: 0 auto 8px;
}

.admin-vanny-overview {
    margin-bottom: 18px;
}

.vanny-confirm-modal .modal-content {
    border: 0;
    border-radius: 16px;
}

.vanny-confirm-modal .modal-body {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 26px;
    text-align: center;
}

.vanny-confirm-modal__mascot {
    width: 128px;
}

.vanny-confirm-modal h3 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0;
}

.vanny-confirm-modal p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.vanny-confirm-modal__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.vanny-swal .swal2-image {
    display: block;
    object-fit: contain;
}

.vanny-swal--modal {
    position: relative;
    width: min(360px, calc(100vw - 32px));
    padding: 24px 22px 20px;
}

.vanny-swal--modal .swal2-image {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 46px !important;
    max-height: 46px;
    margin: 0;
}

.vanny-swal--modal .swal2-icon {
    margin: -4px auto 12px;
    transform: scale(0.72);
    transform-origin: center;
}

.vanny-swal--modal .swal2-title {
    margin: 0;
    padding: 0;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: 0;
}

.vanny-swal--modal .swal2-html-container {
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.45;
}

.vanny-swal--modal .swal2-actions {
    margin: 18px 0 0;
}

.vanny-swal--modal .swal2-confirm,
.vanny-swal--modal .swal2-cancel {
    min-width: 72px;
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 6px;
}

.swal2-toast .swal2-image {
    display: none !important;
}

.swal2-toast .swal2-title {
    margin: 0;
    padding: 0;
    text-align: left;
    line-height: 1.35;
}

html.admin-dark-mode-active .vanny-message-card,
body.admin-dark-mode-active .vanny-message-card,
html.admin-dark-mode-active .vanny-alert,
body.admin-dark-mode-active .vanny-alert,
html.admin-dark-mode-active .vanny-empty-state,
body.admin-dark-mode-active .vanny-empty-state {
    color: #e5edf7;
}

html.admin-dark-mode-active .vanny-message-card,
body.admin-dark-mode-active .vanny-message-card {
    border-color: rgba(148, 163, 184, 0.22);
    background: #172235;
    box-shadow: none;
}

html.admin-dark-mode-active .vanny-message-card p,
body.admin-dark-mode-active .vanny-message-card p,
html.admin-dark-mode-active .vanny-empty-state p,
body.admin-dark-mode-active .vanny-empty-state p {
    color: #9fb1c8;
}

@media (max-width: 680px) {
    .vanny-mascot--small {
        width: 52px;
    }

    .vanny-mascot--medium {
        width: 112px;
    }

    .vanny-mascot--large {
        width: 170px;
    }

    .vanny-message-card {
        align-items: flex-start;
        padding: 14px;
    }
}
