/* ============================================
   ROOT VARIABLES
   ============================================ */
:root {
    --primary: #0F4C81;
    --primary-light: #1a6bb5;
    --secondary: #16A34A;
    --secondary-light: #22c55e;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --bg-white: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border-color: #E5E7EB;
    --shadow-sm: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 12px 48px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.12);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   DARK MODE
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-white: #1F2937;
        --bg-glass: rgba(31, 41, 55, 0.92);
        --text-primary: #F9FAFB;
        --text-secondary: #D1D5DB;
        --text-light: #9CA3AF;
        --border-color: #374151;
    }
}

/* ============================================
   COOKIE BANNER
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 440px;
    width: 100%;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
    padding: 28px 28px 24px;
    z-index: 10000;
    transform: translateY(30px) scale(0.96);
    opacity: 0;
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    font-family: var(--font-family);
}

.cookie-banner.hidden {
    display: none;
}

@keyframes slideUp {
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ============================================
   BANNER CONTENT
   ============================================ */
.cookie-banner .banner-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.cookie-banner .banner-header .icon {
    width: 40px;
    height: 40px;
    background: rgba(15, 76, 129, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cookie-banner .banner-header .icon svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.cookie-banner .banner-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.cookie-banner .banner-description {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.cookie-banner .banner-description a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.cookie-banner .banner-description a:hover {
    text-decoration: underline;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    min-height: 44px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 12px rgba(15, 76, 129, 0.25);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    box-shadow: 0 2px 12px rgba(22, 163, 74, 0.25);
}

.btn-secondary:hover {
    background: var(--secondary-light);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}

.btn-outline:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--primary);
}

.banner-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.banner-actions .btn-row {
    display: flex;
    gap: 10px;
}

.banner-actions .btn-row .btn {
    flex: 1;
}

.preferences-link {
    text-align: center;
    margin-top: 12px;
}

.preferences-link button {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-family);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.preferences-link button:hover {
    color: var(--primary);
}

/* ============================================
   MODAL
   ============================================ */
.cookie-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-modal-overlay.active {
    display: flex;
}

.cookie-modal {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 32px 28px;
    box-shadow: var(--shadow-lg);
}

.cookie-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.cookie-modal .modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cookie-modal .modal-header .close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-secondary);
}

.cookie-modal .modal-header .close-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */
.toggle {
    position: relative;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #D1D5DB;
    border-radius: 26px;
    transition: all var(--transition);
}

.toggle .slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.toggle input:checked+.slider {
    background: var(--primary);
}

.toggle input:checked+.slider::before {
    transform: translateX(18px);
}

.toggle input:disabled+.slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    .cookie-banner {
        bottom: 0;
        right: 0;
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding: 24px 20px 20px;
        border: none;
        border-top: 1px solid var(--border-color);
    }

    .cookie-banner .banner-actions .btn-row {
        flex-direction: column;
    }

    .cookie-banner .banner-actions .btn-row .btn {
        width: 100%;
        flex: none;
    }

    .cookie-modal {
        padding: 24px 18px 20px;
        border-radius: var(--radius-lg);
        max-height: 95vh;
    }

    .cookie-modal .modal-actions {
        flex-direction: column;
    }

    .cookie-modal .modal-actions .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}