/**
 * Alsetha Studio - Cookie consent modal (CMP)
 */

.cookie-consent-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
    z-index: 10050;
}

.cookie-consent-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: #ffffff;
    color: #1f2937;
    border-radius: 16px;
    border: 1px solid rgba(82, 113, 255, 0.2);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
    z-index: 10051;
    padding: 1.5rem;
}

.cookie-consent-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #5271ff;
}

.cookie-consent-description {
    margin: 0 0 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.cookie-consent-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1rem;
}

.cookie-consent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: 2px solid transparent;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cookie-consent-btn:focus-visible {
    outline: 3px solid rgba(82, 113, 255, 0.45);
    outline-offset: 2px;
}

.cookie-consent-btn-primary {
    background: linear-gradient(135deg, rgba(82, 113, 255, 1) 0%, rgba(138, 43, 226, 1) 100%);
    color: #fff;
}

.cookie-consent-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(82, 113, 255, 0.35);
}

.cookie-consent-btn-secondary {
    background: #f3f4f6;
    color: #111827;
    border-color: rgba(82, 113, 255, 0.15);
}

.cookie-consent-btn-secondary:hover {
    background: #e5e7eb;
}

.cookie-consent-btn-outline {
    background: transparent;
    color: #5271ff;
    border-color: rgba(82, 113, 255, 0.35);
}

.cookie-consent-btn-outline:hover {
    background: rgba(82, 113, 255, 0.08);
}

.cookie-consent-customize {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(82, 113, 255, 0.15);
}

.cookie-consent-category {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(82, 113, 255, 0.08);
}

.cookie-consent-category:last-of-type {
    border-bottom: none;
}

.cookie-consent-category-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.cookie-consent-category-desc {
    font-size: 0.85rem;
    margin: 0;
    color: #4b5563;
    line-height: 1.5;
}

.cookie-consent-switch {
    position: relative;
    width: 48px;
    min-width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.cookie-consent-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-consent-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.cookie-consent-switch-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.cookie-consent-switch input:checked + .cookie-consent-switch-slider {
    background: #5271ff;
}

.cookie-consent-switch input:focus-visible + .cookie-consent-switch-slider {
    outline: 3px solid rgba(82, 113, 255, 0.45);
    outline-offset: 2px;
}

.cookie-consent-switch input:checked + .cookie-consent-switch-slider::before {
    transform: translateX(22px);
}

.cookie-consent-switch input:disabled + .cookie-consent-switch-slider {
    opacity: 0.65;
    cursor: not-allowed;
}

.cookie-consent-privacy-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #5271ff;
    text-decoration: underline;
}

.cookie-consent-privacy-link:focus-visible {
    outline: 3px solid rgba(82, 113, 255, 0.45);
    outline-offset: 2px;
}

.cookie-consent-open {
    overflow: hidden;
}

body.dark-mode .cookie-consent-modal {
    background: #1a1a2e;
    color: #e5e7eb;
    border-color: rgba(82, 113, 255, 0.35);
}

body.dark-mode .cookie-consent-category-desc {
    color: #cbd5e1;
}

body.dark-mode .cookie-consent-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #f9fafb;
    border-color: rgba(82, 113, 255, 0.25);
}

body.dark-mode .cookie-consent-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.recaptcha-consent-notice {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
    font-size: 0.9rem;
    line-height: 1.5;
}

.recaptcha-consent-notice button {
    background: none;
    border: none;
    padding: 0;
    color: #5271ff;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
}

body.dark-mode .recaptcha-consent-notice {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.35);
}

@media (min-width: 576px) {
    .cookie-consent-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .cookie-consent-btn {
        flex: 1 1 calc(33.333% - 0.5rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-consent-btn,
    .cookie-consent-switch-slider,
    .cookie-consent-switch-slider::before {
        transition: none;
    }
}

.auth-cookie-link {
    color: rgba(82, 113, 255, 1);
    cursor: pointer;
}

.auth-cookie-link:hover,
.auth-cookie-link:focus {
    color: rgba(61, 90, 232, 1);
}

.auth-cookie-link:focus-visible {
    outline: 2px solid rgba(82, 113, 255, 0.8);
    outline-offset: 2px;
    border-radius: 2px;
}

body.dark-mode .auth-cookie-link {
    color: rgba(147, 168, 255, 1);
}

body.dark-mode .auth-cookie-link:hover,
body.dark-mode .auth-cookie-link:focus {
    color: rgba(180, 196, 255, 1);
}

body.dark-mode a.text-secondary-purple {
    color: #b48cff !important;
}

body.dark-mode a.text-secondary-purple:hover,
body.dark-mode a.text-secondary-purple:focus {
    color: #93a8ff !important;
}

.footer-links a[data-open-cookie-preferences]:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}
