/* ==========================================================================
   Waitlist dialog
   Shown when a visitor clicks a store badge while the app is not published.
   Loaded by /js/waitlist.js (the markup is injected at runtime).
   ========================================================================== */

.wl-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(26, 14, 58, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: wl-fade-in 0.25s ease-out;
}

.wl-overlay [hidden],
.wl-overlay[hidden] {
    display: none !important;
}

.wl-overlay.wl-closing {
    animation: wl-fade-out 0.2s ease-in forwards;
}

.wl-overlay.wl-closing .wl-dialog {
    animation: wl-pop-out 0.2s ease-in forwards;
}

body.wl-lock {
    overflow: hidden;
}

/* Card ------------------------------------------------------------------- */
.wl-dialog {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(26, 14, 58, 0.35);
    color: var(--text-primary, #2B1E4F);
    font-family: 'Inter', sans-serif;
    text-align: center;
    animation: wl-pop-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.wl-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.25s ease;
}

.wl-close:hover {
    background: rgba(255, 255, 255, 0.42);
    transform: rotate(90deg);
}

.wl-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Hero (gradient + mascot overlapping the body) --------------------------- */
.wl-hero {
    position: relative;
    height: 150px;
}

.wl-hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 28px 28px 0 0;
    background: linear-gradient(135deg, #4A1FFF 0%, #7A3BFF 45%, #FF6A3D 100%);
}

.wl-hero-bg::before,
.wl-hero-bg::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.wl-hero-bg::before {
    width: 240px;
    height: 240px;
    top: -140px;
    left: -70px;
}

.wl-hero-bg::after {
    width: 170px;
    height: 170px;
    bottom: -100px;
    right: -40px;
}

.wl-mascot {
    position: absolute;
    left: 50%;
    bottom: -48px;
    z-index: 2;
    width: 150px;
    height: 150px;
    transform: translateX(-50%);
    filter: drop-shadow(0 14px 22px rgba(26, 14, 58, 0.28));
    animation: wl-mascot-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.12s both;
}

/* Body ------------------------------------------------------------------- */
.wl-body,
.wl-success {
    padding: 64px 36px 30px;
}

.wl-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(74, 31, 255, 0.08);
    color: var(--primary-color, #4A1FFF);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wl-pill i {
    font-size: 0.9rem;
}

.wl-title {
    margin: 0.9rem 0 0.5rem;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary, #2B1E4F);
}

.wl-text {
    margin: 0 0 1.5rem;
    color: var(--text-secondary, #6b7280);
    font-size: 1rem;
    line-height: 1.6;
}

.wl-text b {
    color: var(--text-primary, #2B1E4F);
    font-weight: 600;
    word-break: break-all;
}

/* Form ------------------------------------------------------------------- */
.wl-form {
    text-align: left;
}

.wl-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #2B1E4F);
}

.wl-field {
    position: relative;
}

.wl-field i {
    position: absolute;
    top: 50%;
    left: 1.05rem;
    transform: translateY(-50%);
    color: var(--text-secondary, #6b7280);
    pointer-events: none;
    transition: color 0.2s ease;
}

.wl-field input {
    width: 100%;
    padding: 0.95rem 1rem 0.95rem 2.9rem;
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 14px;
    background: var(--background-secondary, #f9fafb);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-primary, #2B1E4F);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.wl-field input::placeholder {
    color: #a1a1aa;
}

.wl-field input:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary-color, #4A1FFF);
    box-shadow: 0 0 0 4px rgba(74, 31, 255, 0.14);
}

.wl-field input:focus + i,
.wl-field:focus-within i {
    color: var(--primary-color, #4A1FFF);
}

.wl-field.is-invalid input {
    border-color: #e11d48;
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.12);
}

.wl-field.is-invalid i {
    color: #e11d48;
}

/* Honeypot: invisible for humans, still in the DOM for bots */
.wl-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.wl-error {
    margin: 0.6rem 0 0;
    font-size: 0.875rem;
    color: #e11d48;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.wl-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, #4A1FFF 0%, #FF6A3D 100%);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(74, 31, 255, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.wl-submit::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #3615CC 0%, #E8552A 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.wl-submit > * {
    position: relative;
}

.wl-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(74, 31, 255, 0.38);
}

.wl-submit:hover:not(:disabled)::before {
    opacity: 1;
}

.wl-submit:focus-visible {
    outline: 3px solid rgba(74, 31, 255, 0.4);
    outline-offset: 3px;
}

.wl-submit:disabled {
    cursor: wait;
    opacity: 0.8;
}

.wl-submit i {
    transition: transform 0.2s ease;
}

.wl-submit:hover:not(:disabled) i {
    transform: translateX(3px);
}

.wl-submit .fa-spinner {
    animation: wl-spin 0.8s linear infinite;
}

.wl-note {
    margin: 1.1rem 0 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary, #6b7280);
}

.wl-note a {
    color: var(--primary-color, #4A1FFF);
    text-decoration: none;
    font-weight: 500;
}

.wl-note a:hover {
    text-decoration: underline;
}

/* Success state ---------------------------------------------------------- */
.wl-check {
    width: 62px;
    height: 62px;
    margin: 0 auto;
    display: block;
}

.wl-check-circle {
    stroke: var(--success, #10b981);
    stroke-width: 2.5;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: wl-draw 0.6s cubic-bezier(0.65, 0, 0.45, 1) 0.15s forwards;
}

.wl-check-mark {
    stroke: var(--success, #10b981);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: wl-draw 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.65s forwards;
}

.wl-success .wl-title {
    margin-top: 1rem;
}

.wl-success .wl-submit {
    margin-top: 0.25rem;
}

.wl-another {
    display: inline-block;
    margin-top: 1rem;
    background: none;
    border: none;
    padding: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary, #6b7280);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.wl-another:hover {
    color: var(--primary-color, #4A1FFF);
}

/* Animations ------------------------------------------------------------- */
@keyframes wl-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes wl-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes wl-pop-in {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes wl-pop-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
}

@keyframes wl-mascot-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(30px) scale(0.6);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes wl-slide-up {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wl-slide-down {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

@keyframes wl-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes wl-spin {
    to { transform: rotate(360deg); }
}

/* Mobile: bottom sheet --------------------------------------------------- */
@media (max-width: 520px) {
    .wl-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .wl-dialog {
        max-width: none;
        max-height: 94vh;
        max-height: 94dvh;
        border-radius: 28px 28px 0 0;
        animation: wl-slide-up 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .wl-overlay.wl-closing .wl-dialog {
        animation: wl-slide-down 0.22s ease-in forwards;
    }

    .wl-hero {
        height: 130px;
    }

    .wl-mascot {
        width: 130px;
        height: 130px;
        bottom: -40px;
    }

    .wl-body,
    .wl-success {
        padding: 56px 22px calc(26px + env(safe-area-inset-bottom, 0px));
    }

    .wl-title {
        font-size: 1.45rem;
    }
}

/* Reduced motion --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .wl-overlay,
    .wl-dialog,
    .wl-mascot,
    .wl-overlay.wl-closing,
    .wl-overlay.wl-closing .wl-dialog {
        animation: none;
    }

    .wl-check-circle,
    .wl-check-mark {
        animation: none;
        stroke-dashoffset: 0;
    }

    .wl-close,
    .wl-submit,
    .wl-submit i {
        transition: none;
    }
}
