/* ═══ SCROLL PROGRESS BAR ═══ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    z-index: 9999;
    background: var(--grad-luxury);
    width: 0%;
    transition: width 0.1s linear;
}

/* ═══ NOISE TEXTURE ═══ */
.noise {
    position: fixed;
    inset: 0;
    z-index: 9990;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px;
}

[data-theme="dark"] .noise {
    opacity: 0.04;
}

/* ═══ CUSTOM CURSOR ═══ */
.cursor-orb {
    position: fixed;
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--rose);
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: difference;
    opacity: 0;
    transition: width 0.5s var(--ease), height 0.5s var(--ease), opacity 0.4s;
    will-change: transform;
}

.cursor-orb.visible {
    opacity: 0.8;
}

.cursor-orb.expand {
    width: 60px;
    height: 60px;
    opacity: 0.4;
}

@media (pointer: coarse) {
    .cursor-orb {
        display: none;
    }
}

/* ═══ PRELOADER ═══ */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--burgundy-deep);
}

.preloader.done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.8s var(--ease), visibility 0.8s;
}

.preloader__brand {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: var(--gold-light);
    font-weight: 600;
    letter-spacing: 0.06em;
    overflow: hidden;
}

.preloader__brand span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
}

.preloader__line {
    width: 0;
    height: 1px;
    background: var(--gold);
    margin-top: 1.5rem;
}

.preloader__tagline {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--rose-light);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 1rem;
    opacity: 0;
}

/* ═══ STICKY CTA BAR ═══ */
.sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 190;
    padding: 0.875rem 0;
    background: linear-gradient(90deg, rgba(251, 247, 242, 0.96) 0%, rgba(245, 237, 227, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-a);
    transform: translateY(100%);
    transition: transform 0.5s var(--ease);
    overflow: hidden;
    box-shadow: 0 -12px 42px rgba(107, 45, 62, 0.3), 0 -2px 18px rgba(201, 169, 110, 0.28);
    animation: stickyGlow 1.9s ease-in-out infinite;
}

.sticky-cta::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -45%;
    width: 42%;
    pointer-events: none;
    background: linear-gradient(100deg, rgba(201, 169, 110, 0), rgba(201, 169, 110, 0.7), rgba(201, 169, 110, 0));
    opacity: 0.75;
    transform: skewX(-18deg);
    animation: stickySweep 2.8s linear infinite;
}

.sticky-cta::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: min(620px, 92vw);
    height: 2px;
    transform: translateX(-50%);
    pointer-events: none;
    background: linear-gradient(90deg, rgba(201, 169, 110, 0), rgba(201, 169, 110, 0.95), rgba(201, 169, 110, 0));
    box-shadow: 0 0 22px rgba(201, 169, 110, 0.85);
}

@keyframes stickyGlow {

    0%,
    100% {
        box-shadow: 0 -10px 34px rgba(107, 45, 62, 0.24), 0 -2px 14px rgba(201, 169, 110, 0.24);
    }

    50% {
        box-shadow: 0 -18px 62px rgba(107, 45, 62, 0.44), 0 -8px 30px rgba(201, 169, 110, 0.5);
    }
}

@keyframes stickySweep {
    0% {
        left: -45%;
    }

    100% {
        left: 120%;
    }
}

.sticky-cta.visible {
    transform: translateY(0);
}

[data-theme="dark"] .sticky-cta {
    background: linear-gradient(90deg, rgba(26, 19, 22, 0.96) 0%, rgba(44, 34, 38, 0.95) 100%);
    box-shadow: 0 -12px 44px rgba(201, 169, 110, 0.26), 0 -4px 20px rgba(201, 169, 110, 0.18);
}

[data-theme="dark"] .sticky-cta::before {
    background: linear-gradient(100deg, rgba(201, 169, 110, 0), rgba(201, 169, 110, 0.58), rgba(201, 169, 110, 0));
}

.sticky-cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.sticky-cta__text {
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sticky-cta__course {
    color: var(--burgundy);
}

[data-theme="dark"] .sticky-cta__course {
    color: var(--gold-light);
}

.sticky-cta__flash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(90deg, #be3c2f 0%, #df6350 45%, #be3c2f 100%);
    box-shadow: 0 0 16px rgba(226, 91, 69, 0.58);
    animation: flashPulse 1.2s ease-in-out infinite;
}

@keyframes flashPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 12px rgba(226, 91, 69, 0.42);
    }

    50% {
        transform: scale(1.04);
        box-shadow: 0 0 22px rgba(226, 91, 69, 0.72);
    }
}

.sticky-cta__text>span:not(.sticky-cta__flash) {
    color: var(--text-sec);
    font-weight: 400;
    display: none;
}

@media (min-width: 640px) {
    .sticky-cta__text>span:not(.sticky-cta__flash) {
        display: inline;
    }
}

.sticky-cta .btn--gold {
    box-shadow: 0 0 0 rgba(201, 169, 110, 0), 0 0 0 rgba(201, 169, 110, 0);
    animation: ctaButtonGlow 1.9s ease-in-out infinite;
}

@keyframes ctaButtonGlow {

    0%,
    100% {
        box-shadow: 0 0 0 rgba(201, 169, 110, 0), 0 0 0 rgba(201, 169, 110, 0);
    }

    50% {
        box-shadow: 0 0 24px rgba(201, 169, 110, 0.45), 0 0 44px rgba(201, 169, 110, 0.25);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sticky-cta {
        animation: none;
    }

    .sticky-cta::before,
    .sticky-cta__flash,
    .sticky-cta .btn--gold {
        animation: none;
    }
}

/* ═══ EXIT INTENT POPUP ═══ */
.popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(44, 34, 38, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s;
    padding: 1.5rem;
}

.popup-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.popup {
    background: var(--surface);
    border-radius: 28px;
    padding: clamp(2rem, 5vw, 3rem);
    max-width: 480px;
    width: 100%;
    position: relative;
    text-align: center;
    box-shadow: var(--sh-xl);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.5s var(--ease);
}

.popup-overlay.visible .popup {
    transform: translateY(0) scale(1);
}

.popup__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: var(--text-sec);
    transition: all 0.3s;
}

.popup__close:hover {
    background: var(--cream-deep);
    color: var(--text);
}

.popup__emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.popup__emoji .material-symbols-rounded {
    font-size: 3rem;
}

.popup__title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.popup__desc {
    font-size: 0.9375rem;
    color: var(--text-sec);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.popup__input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
    font-family: var(--font-body);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    background: var(--bg-alt);
    color: var(--text);
    margin-bottom: 0.75rem;
}

.popup__input:focus {
    outline: none;
    border-color: var(--rose);
}

/* ═══ FLASH OFFER MODAL ═══ */
.popup--flash {
    max-width: 500px;
    background: var(--surface);
    border: 1px solid var(--border-a);
}

.popup--flash .popup__emoji {
    color: var(--gold);
}

.flash-form .form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.popup__content[hidden] {
    display: none;
}

.popup__note {
    font-family: var(--font-mono);
    color: var(--text-sec);
}

[data-theme="dark"] .popup--flash {
    background: #1a1316;
    /* Darker background for contrast */
}

/* ═══ COURSE MODALS ═══ */
.popup--course {
    max-width: 860px;
    width: min(100%, 860px);
    text-align: left;
    border: 1px solid var(--border-a);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0)),
        var(--surface);
    padding: clamp(1.4rem, 3vw, 2rem);
    max-height: min(88vh, 980px);
    overflow: auto;
}

.popup--course-lg {
    max-width: 960px;
    width: min(100%, 960px);
}

.course-modal {
    display: grid;
    gap: 1rem;
}

.course-modal__badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 30px;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--border));
    background: color-mix(in srgb, var(--gold-light) 16%, transparent);
    color: color-mix(in srgb, var(--gold) 70%, var(--text));
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 700;
}

.course-modal__badge--rose {
    border-color: color-mix(in srgb, var(--rose) 40%, var(--border));
    background: color-mix(in srgb, var(--rose) 14%, transparent);
    color: color-mix(in srgb, var(--rose) 80%, var(--text));
}

.course-modal__badge--gold {
    border-color: color-mix(in srgb, var(--gold) 45%, var(--border));
}

.course-modal__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2vw + 0.8rem, 2.2rem);
    line-height: 1.08;
    color: var(--text);
}

.course-modal__intro {
    margin: 0;
    color: var(--text-sec);
    line-height: 1.65;
    font-size: 0.98rem;
}

.course-modal__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.course-modal__pill {
    border-radius: 999px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    color: var(--text-sec);
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
    line-height: 1.2;
}

.course-modal__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.course-modal__grid--single {
    grid-template-columns: 1fr;
}

.course-modal__panel {
    border-radius: 18px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 86%, var(--bg-alt));
    padding: 1rem;
}

.course-modal__panel h4 {
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
    color: var(--text);
    letter-spacing: 0.01em;
}

.course-modal__list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.45rem;
    color: var(--text-sec);
    line-height: 1.55;
    font-size: 0.9rem;
}

.course-modal__highlight {
    border-radius: 18px;
    padding: 0.95rem 1rem;
    border: 1px solid color-mix(in srgb, var(--rose) 24%, var(--border));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--rose) 10%, transparent), transparent 40%),
        color-mix(in srgb, var(--surface) 90%, var(--bg-alt));
}

.course-modal__highlight p {
    margin: 0;
    color: var(--text-sec);
    line-height: 1.55;
    font-size: 0.9rem;
}

.course-modal__highlight p + p {
    margin-top: 0.5rem;
}

.course-modal__note {
    margin: 0.75rem 0 0;
    color: var(--text-sec);
    line-height: 1.55;
    font-size: 0.9rem;
}

.course-modal__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.course-modal__cta .btn {
    flex: 1 1 220px;
    justify-content: center;
}

.course-modal__form {
    display: grid;
    gap: 0.85rem;
}

.course-modal__form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.course-modal__form .popup__input {
    margin-bottom: 0;
    border-radius: 14px;
    background: var(--bg);
}

.popup__textarea {
    border-radius: 16px;
    min-height: 96px;
    resize: vertical;
}

[data-theme="dark"] .popup--course {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)),
        #1a1316;
}

[data-theme="dark"] .course-modal__panel,
[data-theme="dark"] .course-modal__highlight {
    background: color-mix(in srgb, var(--surface) 74%, rgba(255,255,255,0.01));
}

@media (max-width: 768px) {
    .popup--course,
    .popup--course-lg {
        max-height: min(90vh, 980px);
        padding: 1rem;
        border-radius: 22px;
    }

    .course-modal__grid,
    .course-modal__form-grid {
        grid-template-columns: 1fr;
    }

    .course-modal__cta .btn {
        flex-basis: 100%;
    }

    .course-modal__title {
        padding-right: 1.6rem;
    }
}
