/* =========================================
   KRISTON LAW — EDITORIAL DESIGN TOKENS & BASE THEME
   International Boutique Law Firm Aesthetic
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,600&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

/* =========================================
   1. DESIGN TOKENS
   ========================================= */

:root {
    /* Primary Editorial Law Palette */
    --kl-charcoal: #201F1E;
    --kl-black: #171615;
    --kl-ivory: #F5F1E9;
    --kl-cream: #EEE9E0;
    --kl-gold: #C5A15A;
    --kl-gold-dark: #A98950;
    --kl-ash: #B9B5AE;
    --kl-stone: #DDD8CF;
    --kl-muted: #77736D;
    --kl-white: #FFFFFF;
    --kl-ink: #292725;

    /* Mapped Legacy Tokens (Zero Breakage for Existing Classes) */
    --qb-primary: #C5A15A;
    --qb-primary-dark: #A98950;
    --qb-primary-light: #DFC388;

    --qb-navy: #171615;
    --qb-text: #292725;
    --qb-text-muted: #77736D;

    /* Backgrounds */
    --qb-white: #FFFFFF;
    --qb-background: #F5F1E9;
    --qb-ice: #EEE9E0;

    /* Supporting Accents */
    --qb-purple: #8C6D3F;
    --qb-green: #15803D;
    --qb-orange: #C5A15A;
    --qb-pink: #9F1239;
    --qb-teal: #2F5D50;

    /* Editorial Gradients */
    --qb-gradient-primary: linear-gradient(135deg, #D8BA7D 0%, #C5A15A 55%, #A98950 100%);
    --qb-gradient-soft: linear-gradient(135deg, #F5F1E9 0%, #EEE9E0 100%);
    --qb-gradient-hero: linear-gradient(135deg, #F5F1E9 0%, #EEE9E0 68%, #E5DFD4 100%);
    --qb-gradient-card: linear-gradient(180deg, #FBF9F5 0%, #F5F1E9 100%);

    /* Borders */
    --qb-border: 1px solid #DDD8CF;
    --qb-border-subtle: 1px solid #E5E0D6;

    /* Refined Editorial Shadows */
    --qb-shadow: 0 8px 28px -8px rgba(23, 22, 21, 0.08);
    --qb-shadow-hover: 0 16px 36px -10px rgba(23, 22, 21, 0.14);
    --qb-shadow-button: 0 6px 18px -4px rgba(169, 137, 80, 0.32);
    --qb-shadow-card-3d: 0 10px 26px -6px rgba(23, 22, 21, 0.1), 0 4px 10px rgba(23, 22, 21, 0.04);

    /* Border radius */
    --qb-radius-sm: 12px;
    --qb-radius-md: 18px;
    --qb-radius-lg: 24px;
    --qb-radius-pill: 999px;

    /* Typography */
    --qb-font: 'Manrope', 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    --kl-serif: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;

    /* Transitions */
    --qb-transition: 0.22s ease;
}

/* =========================================
   2. GLOBAL STYLING
   ========================================= */

:where(body.qbee-theme, .qbee-theme) {
    color: var(--qb-text);
}

body.qbee-theme,
.qbee-theme {
    font-family: var(--qb-font);
    background-color: #F5F1E9;
    background-image: radial-gradient(circle at 18% 12%, rgba(197, 161, 90, 0.06) 0%, transparent 48%), linear-gradient(180deg, #F5F1E9 0%, #EFEAE1 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.qbee-theme *,
.qbee-theme *::before,
.qbee-theme *::after {
    box-sizing: border-box;
}

:where(.qbee-theme h1, .qbee-theme h2, .qbee-theme h3, .qbee-theme h4) {
    color: var(--kl-black);
}

.qbee-theme h1,
.qbee-theme h2,
.qbee-theme h3,
.qbee-theme h4 {
    font-family: var(--kl-serif);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.qbee-theme p {
    line-height: 1.6;
}

.qbee-theme a {
    text-decoration: none;
    transition: color var(--qb-transition), background-color var(--qb-transition), border-color var(--qb-transition);
}

/* =========================================
   3. EDITORIAL CARDS
   ========================================= */

.qb-card,
.qbee-theme .card,
.qbee-theme .card-soft {
    background: #FBF9F5;
    border: 1px solid #DDD8CF;
    border-radius: var(--qb-radius-lg);
    box-shadow: var(--qb-shadow);
    padding: 22px;
    transition: transform var(--qb-transition), box-shadow var(--qb-transition), border-color var(--qb-transition);
}

.qb-card-interactive:hover,
.qbee-theme .card-3d:hover {
    transform: translateY(-3px);
    box-shadow: var(--qb-shadow-hover);
    border-color: #C5A15A;
}

.qbee-theme .card-3d {
    background: #FBF9F5;
    border: 1.5px solid #DDD8CF;
    border-top: 2px solid #FFFFFF;
    border-bottom: 3.5px solid #CFC8BC;
    border-radius: var(--qb-radius-lg);
    box-shadow: 0 12px 26px -8px rgba(23, 22, 21, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.qbee-theme .card-3d:active {
    transform: translateY(2px);
    box-shadow: 0 4px 12px -4px rgba(23, 22, 21, 0.08);
}

/* =========================================
   4. HERO / WELCOME SECTIONS
   ========================================= */

.qb-hero,
.qbee-theme .hero {
    position: relative;
    background: linear-gradient(135deg, #F5F1E9 0%, #EEE9E0 72%, #E8E2D7 100%);
    border-radius: var(--qb-radius-lg);
    padding: 32px;
    color: #292725;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid #DDD8CF;
    box-shadow: 0 16px 36px -14px rgba(23, 22, 21, 0.14);
}

.qb-hero h1,
.qb-hero h2,
.qbee-theme .hero h1,
.qbee-theme .hero h2 {
    color: #171615;
    font-family: var(--kl-serif);
}

.qb-hero p,
.qbee-theme .hero p {
    color: #57534E;
}

/* =========================================
   5. BUTTONS (CHAMPAGNE GOLD & DEEP CHARCOAL)
   ========================================= */

.qb-btn-primary,
.qbee-theme .primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 24px;
    border: 1px solid #A98950;
    border-radius: var(--qb-radius-pill);
    background: linear-gradient(180deg, #D9BC7E 0%, #C5A15A 55%, #B18C47 100%);
    color: #171615 !important;
    font-family: var(--qb-font);
    font-weight: 800;
    font-size: 13.5px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 251, 240, 0.6), 0 6px 16px -4px rgba(169, 137, 80, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    text-decoration: none;
}

.qb-btn-primary:hover,
.qbee-theme .primary-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: inset 0 1px 0 rgba(255, 251, 240, 0.7), 0 10px 22px -4px rgba(169, 137, 80, 0.42);
}

.qb-btn-primary:active,
.qbee-theme .primary-btn:active {
    transform: translateY(1px);
}

.qb-btn-secondary,
.qbee-theme .secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 11px 24px;
    background: #F5F1E9;
    color: #201F1E !important;
    border: 1px solid #C5A15A;
    border-radius: var(--qb-radius-pill);
    font-weight: 700;
    font-size: 13.5px;
    font-family: var(--qb-font);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(23, 22, 21, 0.06);
    transition: all 0.2s ease;
    text-decoration: none;
}

.qb-btn-secondary:hover,
.qbee-theme .secondary-btn:hover {
    background: #EEE9E0;
    border-color: #A98950;
    transform: translateY(-1px);
}

/* =========================================
   6. FORM INPUTS & SELECTS
   ========================================= */

.qb-input,
.qb-select,
.qb-textarea,
.qbee-theme input[type="text"],
.qbee-theme input[type="email"],
.qbee-theme input[type="password"],
.qbee-theme input[type="number"],
.qbee-theme input[type="search"],
.qbee-theme select,
.qbee-theme textarea {
    width: 100%;
    min-height: 44px;
    padding: 11px 16px;
    border-radius: 14px;
    border: 1px solid #DDD8CF;
    background: #EEE9E0;
    color: #292725;
    font-family: var(--qb-font);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.qb-input:focus,
.qb-select:focus,
.qb-textarea:focus,
.qbee-theme input:focus,
.qbee-theme select:focus,
.qbee-theme textarea:focus {
    background: #FFFFFF;
    border-color: #C5A15A;
    box-shadow: 0 0 0 3px rgba(197, 161, 90, 0.2);
}

/* =========================================
   7. EDITORIAL ICONS
   ========================================= */

.qb-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #F5F1E9;
    font-size: 19px;
    background: linear-gradient(145deg, #292725, #171615);
    border: 1px solid #C5A15A;
    box-shadow: 0 6px 16px rgba(23, 22, 21, 0.16);
    flex-shrink: 0;
}

.qb-icon-blue   { background: linear-gradient(145deg, #292725, #171615); color: #C5A15A; }
.qb-icon-purple { background: linear-gradient(145deg, #C5A15A, #A98950); color: #171615; }
.qb-icon-green  { background: linear-gradient(145deg, #204E3A, #143326); color: #F5F1E9; }
.qb-icon-orange { background: linear-gradient(145deg, #D2B16C, #A98950); color: #171615; }
.qb-icon-pink   { background: linear-gradient(145deg, #6E2233, #4A1522); color: #F5F1E9; }
.qb-icon-teal   { background: linear-gradient(145deg, #2B4541, #1B2E2B); color: #F5F1E9; }

/* =========================================
   8. PROGRESS BARS
   ========================================= */

.qb-progress,
.qbee-theme .progress-track {
    width: 100%;
    height: 8px;
    background: #DDD8CF;
    border-radius: 100px;
    overflow: hidden;
}

.qb-progress-fill,
.qbee-theme .progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #A98950, #C5A15A, #DEC184);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   9. CHARCOAL SIDEBAR / NAVIGATION
   ========================================= */

.qb-sidebar,
.qbee-theme aside {
    background: #201F1E;
    border-right: 1px solid #2E2C29;
}

.qb-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: 16px;
    color: #E5E0D7;
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
    transition: all 0.2s ease;
}

.qb-nav-item:hover {
    background: rgba(245, 241, 233, 0.08);
    color: #FFFFFF;
}

.qb-nav-item.active {
    background: #F5F1E9;
    color: #201F1E;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* =========================================
   10. BADGES
   ========================================= */

.qb-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
}

.qb-badge-success {
    background: #EAF4EE;
    color: #166534;
    border: 1px solid #BBDFC8;
}

.qb-badge-info {
    background: #EEE9E0;
    color: #292725;
    border: 1px solid #DDD8CF;
}

.qb-badge-warning {
    background: #FAF1DE;
    color: #7C5819;
    border: 1px solid #E2CA96;
}

/* =========================================
   11. SPLASH SCREEN STYLES
   ========================================= */

.qb-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #F5F1E9 20%, #EEE9E0 75%, #E3DDD2 100%);
    transition: opacity 0.55s ease, visibility 0.55s ease;
    overflow: hidden;
}

.qb-splash.hidden-splash {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.qb-splash-logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: qbSplashEntrance 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes qbSplashEntrance {
    0% {
        opacity: 0;
        transform: scale(0.86) translateY(16px);
    }
    55% {
        opacity: 1;
        transform: scale(1.01) translateY(-2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.qb-splash-glow {
    position: absolute;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(197, 161, 90, 0.22) 0%, rgba(245, 241, 233, 0) 70%);
    pointer-events: none;
    animation: qbPulse 3s ease-in-out infinite;
}

@keyframes qbPulse {
    0%, 100% { transform: scale(1); opacity: 0.65; }
    50% { transform: scale(1.12); opacity: 0.95; }
}

/* =========================================
   12. MASCOT PLACEMENT SYSTEM
   ========================================= */

.qb-mascot-slot {
    position: relative;
    display: inline-block;
}

.qb-mascot-placed {
    position: absolute;
    pointer-events: none;
    z-index: 20;
    user-select: none;
    filter: drop-shadow(0 8px 16px rgba(23, 22, 21, 0.18));
}

.qb-pos-top-left      { top: -24px; left: -20px; }
.qb-pos-top-right     { top: -24px; right: -20px; }
.qb-pos-bottom-left   { bottom: -24px; left: -20px; }
.qb-pos-bottom-right  { bottom: -24px; right: -20px; }
.qb-pos-card-corner   { top: -28px; right: 16px; }
.qb-pos-beside-heading { position: relative; top: auto; right: auto; margin-left: 10px; display: inline-block; vertical-align: middle; }
.qb-pos-beside-text   { position: relative; top: auto; right: auto; margin-right: 8px; display: inline-block; vertical-align: middle; }

@media (max-width: 768px) {
    .qb-card {
        padding: 16px;
        border-radius: 18px;
    }
    .qb-hero {
        padding: 20px;
    }
    .qb-pos-top-left   { top: -14px; left: -10px; }
    .qb-pos-top-right  { top: -14px; right: -10px; }
    .qb-pos-card-corner { top: -18px; right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .qbee-theme *,
    .qbee-theme *::before,
    .qbee-theme *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark footer & dark bar contrast safety net */
footer.bg-\[\#201F1E\],
footer.bg-\[\#171615\],
.kl-topbar,
.kl-sidebar,
.kl-mobile-bottom-bar {
    color: #F5EEDB;
}

footer.bg-\[\#201F1E\] h1,
footer.bg-\[\#201F1E\] h2,
footer.bg-\[\#201F1E\] h3,
footer.bg-\[\#201F1E\] h4,
footer.bg-\[\#171615\] h1,
footer.bg-\[\#171615\] h2,
footer.bg-\[\#171615\] h3,
footer.bg-\[\#171615\] h4 {
    color: #F5EEDB !important;
}

footer.bg-\[\#201F1E\] p,
footer.bg-\[\#201F1E\] li,
footer.bg-\[\#201F1E\] span:not(.text-\[\#D6BC82\]):not(.text-\[\#C5A15A\]):not(.text-\[\#F5E6B8\]),
footer.bg-\[\#171615\] p,
footer.bg-\[\#171615\] li,
footer.bg-\[\#171615\] span:not(.text-\[\#D6BC82\]):not(.text-\[\#C5A15A\]):not(.text-\[\#F5E6B8\]) {
    color: #EBDAB3;
}

footer.bg-\[\#201F1E\] a,
footer.bg-\[\#171615\] a {
    color: #F5EEDB;
}

footer.bg-\[\#201F1E\] a:hover,
footer.bg-\[\#171615\] a:hover {
    color: #F5E6B8 !important;
}

