/**
 * Streamit Unified Auth Design System Styles
 * 
 * Strict White-Label & System Branding Adherence (WORE Enforcement).
 * Inherits all colors dynamically from configured system design tokens:
 * --bs-primary, --bs-primary-rgb, and system theme settings.
 * ZERO hardcoded colors.
 */

/* ========================================================================= */
/* 1. REUSABLE PHONE AUTH CTA COMPONENT (Landing Page & Hero)                */
/* ========================================================================= */
.streamit-phone-auth-cta {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
}

.streamit-phone-auth-cta .streamit-cta-input-group {
    background: rgba(18, 18, 24, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 4px 6px 4px 18px;
    transition: all 0.25s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.streamit-phone-auth-cta .streamit-cta-input-group:focus-within {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.25), 0 10px 35px rgba(0, 0, 0, 0.6);
    background: rgba(22, 22, 30, 0.95);
}

.streamit-phone-auth-cta .streamit-cta-icon {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.25rem;
    padding-left: 0;
    padding-right: 8px;
}

.streamit-phone-auth-cta .streamit-cta-input {
    background: transparent;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 12px 8px;
}

.streamit-phone-auth-cta .streamit-cta-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}

.streamit-phone-auth-cta .streamit-cta-input:focus {
    background: transparent;
    color: #ffffff;
    box-shadow: none;
    outline: none;
}

.streamit-phone-auth-cta .streamit-cta-btn {
    border-radius: 40px;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    padding: 12px 28px;
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.35);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.streamit-phone-auth-cta .streamit-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--bs-primary-rgb), 0.45);
}

.streamit-phone-auth-cta .streamit-cta-btn .streamit-btn-icon {
    transition: transform 0.2s ease;
}

.streamit-phone-auth-cta .streamit-cta-btn:hover .streamit-btn-icon {
    transform: translateX(3px);
}

/* Compact CTA variant */
.streamit-phone-auth-cta-md .streamit-cta-input-group {
    padding: 3px 4px 3px 14px;
}

.streamit-phone-auth-cta-md .streamit-cta-input {
    font-size: 0.95rem;
    padding: 8px 6px;
}

.streamit-phone-auth-cta-md .streamit-cta-btn {
    font-size: 0.95rem;
    padding: 8px 20px;
}

@media (max-width: 575.98px) {
    .streamit-phone-auth-cta .streamit-cta-input-group {
        border-radius: 16px;
        padding: 8px;
        flex-direction: column;
        gap: 8px;
    }
    .streamit-phone-auth-cta .streamit-cta-btn {
        width: 100%;
        border-radius: 12px;
        padding: 12px;
    }
    .streamit-phone-auth-cta .streamit-cta-input {
        text-align: center;
    }
    .streamit-phone-auth-cta .streamit-cta-icon {
        display: none;
    }
}

/* ========================================================================= */
/* 2. UNIFIED AUTH SCREEN & FORM CARDS                                       */
/* ========================================================================= */
.unified-auth-screen .user-login-card {
    background: rgba(18, 18, 22, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.unified-auth-screen .form-control {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-radius: 10px;
}

.unified-auth-screen .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.25);
    color: #ffffff;
}

.unified-auth-screen .auth-step-panel {
    animation: authFadeInStep 0.3s ease-in-out;
}

@keyframes authFadeInStep {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Single-Auth Intent & Branding Notice */
.unified-auth-intent-banner {
    background: rgba(var(--bs-primary-rgb), 0.15) !important;
    border-left: 4px solid var(--bs-primary) !important;
}

/* ========================================================================= */
/* 3. 4-DIGIT PIN & OTP BOX INPUTS                                           */
/* ========================================================================= */
.otp-input {
    width: 52px;
    height: 54px;
    font-size: 1.4rem;
    text-align: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transition: all 0.2s ease;
}

.otp-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.25);
    outline: none;
    color: #ffffff;
}

.otp-input.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25) !important;
}

@media (max-width: 575.98px) {
    .otp-input {
        width: 44px;
        height: 48px;
        font-size: 1.25rem;
    }
}

/* ========================================================================= */
/* 4. SMART TV CODE FLOATING WIDGET & PAIRING MODAL                         */
/* ========================================================================= */
#tv-code-floating-widget {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 1040;
    background: rgba(18, 18, 24, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 50px;
    padding: 10px 20px 10px 12px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    -webkit-user-select: none;
    outline: none;
    color: #ffffff;
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

#tv-code-floating-widget:hover,
#tv-code-floating-widget:focus,
#tv-code-floating-widget:focus-visible,
#tv-code-floating-widget.tv-remote-focused,
#btn-open-tv-from-card:focus,
#btn-open-tv-from-card:focus-visible {
    transform: translateY(-3px) scale(1.03) translateZ(0);
    -webkit-transform: translateY(-3px) scale(1.03) translateZ(0);
    background: rgba(26, 26, 36, 0.98);
    border-color: var(--bs-primary) !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.8), 0 0 0 3px rgba(var(--bs-primary-rgb), 0.8), 0 0 25px rgba(var(--bs-primary-rgb), 0.5) !important;
    outline: 2px solid var(--bs-primary) !important;
    outline-offset: 2px;
}

#tv-code-floating-widget .tv-widget-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bs-primary), rgba(var(--bs-primary-rgb), 0.75));
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.4);
    flex-shrink: 0;
    position: relative;
}

#tv-code-floating-widget .tv-radar-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.85);
    animation: tvRadarPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
    pointer-events: none;
}

@keyframes tvRadarPulse {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(1.6); opacity: 0; }
}

#tv-code-floating-widget .tv-widget-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

#tv-code-floating-widget .tv-widget-subtitle {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
}

/* TV Login Modal Overlay */
#tv-login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#tv-login-modal-overlay.d-none {
    display: none !important;
}

#tv-login-modal-overlay .tv-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 6, 8, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#tv-login-modal-overlay .tv-modal-dialog {
    position: relative;
    z-index: 10;
    max-width: 820px;
    width: 100%;
    animation: tvModalFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tvModalFadeIn {
    from { opacity: 0; transform: scale(0.94) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

#tv-login-modal-overlay .tv-modal-card {
    background: rgba(18, 18, 24, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 2.2rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

#tv-login-modal-overlay .tv-header-icon-box {
    width: 48px;
    height: 48px;
    background: rgba(var(--bs-primary-rgb), 0.15);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.3);
}

#tv-login-modal-overlay .step-number-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(var(--bs-primary-rgb), 0.2);
    border: 1px solid var(--bs-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

#tv-login-modal-overlay .tv-code-char {
    width: 34px;
    height: 38px;
    background: rgba(17, 17, 24, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    font-family: 'SF Pro Mono', Consolas, Monaco, monospace;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

#tv-login-modal-overlay .tv-code-display-container:hover .tv-code-char {
    border-color: rgba(var(--bs-primary-rgb), 0.5);
    background: rgba(var(--bs-primary-rgb), 0.06);
}

#tv-login-modal-overlay .tv-status-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #198754;
    display: inline-block;
    box-shadow: 0 0 10px #198754;
    animation: statusBlink 1.5s infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

#tv-login-modal-overlay .tv-qr-box {
    position: relative;
}

#tv-login-modal-overlay .tv-qr-viewfinder-corners .corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--bs-primary);
    border-style: solid;
}

#tv-login-modal-overlay .tv-qr-viewfinder-corners .top-left {
    top: 10px;
    left: 10px;
    border-width: 3px 0 0 3px;
    border-top-left-radius: 8px;
}

#tv-login-modal-overlay .tv-qr-viewfinder-corners .top-right {
    top: 10px;
    right: 10px;
    border-width: 3px 3px 0 0;
    border-top-right-radius: 8px;
}

#tv-login-modal-overlay .tv-qr-viewfinder-corners .bottom-left {
    bottom: 10px;
    left: 10px;
    border-width: 0 0 3px 3px;
    border-bottom-left-radius: 8px;
}

#tv-login-modal-overlay .tv-qr-viewfinder-corners .bottom-right {
    bottom: 10px;
    right: 10px;
    border-width: 0 3px 3px 0;
    border-bottom-right-radius: 8px;
}

#tv-qr-container svg {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* STRICT MOBILE EXCLUSION: Never show widget or overlay on mobile screen sizes (< 768px) */
@media (max-width: 767.98px) {
    #tv-code-floating-widget,
    #tv-login-modal-overlay {
        display: none !important;
    }
}

/* ==========================================================================
   GUEST HOMEPAGE / NETFLIX-STYLE HERO & PHONE CTA
   ========================================================================== */

/* Cinematic Netflix Hero Section */
.guest-netflix-hero {
    min-height: 85vh;
    padding-top: 100px;
    padding-bottom: 60px;
    background-color: var(--bs-body-bg, #111111);
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.guest-hero-radial-glow {
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(circle, rgba(var(--bs-primary-rgb), 0.18) 0%, rgba(var(--bs-primary-rgb), 0) 70%);
    filter: blur(60px);
    z-index: 1;
}

.guest-hero-container {
    z-index: 2;
}

.guest-hero-pill-badge {
    background: rgba(var(--bs-primary-rgb), 0.15);
    color: var(--bs-primary);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.35);
    border-radius: 50rem;
    letter-spacing: 1px;
    font-size: 0.78rem;
    box-shadow: 0 0 20px rgba(var(--bs-primary-rgb), 0.25);
    backdrop-filter: blur(8px);
}

.guest-hero-title {
    font-weight: 900;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}

.guest-hero-subtitle {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Phone CTA Molecule */
.streamit-phone-auth-cta {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
}

.streamit-cta-input-group {
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    border-radius: 50rem;
    padding: 4px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.streamit-cta-input-group:focus-within {
    border-color: var(--bs-primary);
    box-shadow: 0 0 25px rgba(var(--bs-primary-rgb), 0.45);
}

.streamit-cta-icon {
    background: transparent !important;
    color: var(--bs-primary);
    font-size: 1.35rem;
    padding-left: 1.25rem;
    padding-right: 0.5rem;
}

.streamit-cta-input {
    background: transparent !important;
    color: #ffffff !important;
    font-size: 1.1rem;
    font-weight: 500;
    height: 56px;
    padding-left: 0.5rem;
    padding-right: 1rem;
    box-shadow: none !important;
}

.streamit-cta-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}

.streamit-cta-btn {
    height: 56px;
    border-radius: 50rem !important;
    padding: 0 2rem;
    font-size: 1.15rem;
    letter-spacing: 0.2px;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    box-shadow: 0 4px 18px rgba(var(--bs-primary-rgb), 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    white-space: nowrap;
}

.streamit-cta-btn:hover {
    filter: brightness(1.12);
    box-shadow: 0 6px 24px rgba(var(--bs-primary-rgb), 0.6);
    transform: translateY(-1px);
}

.streamit-cta-btn:active {
    transform: translateY(0);
}

.streamit-phone-auth-cta-md .streamit-cta-input {
    height: 48px;
    font-size: 1rem;
}

.streamit-phone-auth-cta-md .streamit-cta-btn {
    height: 48px;
    font-size: 1rem;
    padding: 0 1.5rem;
}

/* Guest Header Sign In Button */
.guest-header-signin-btn {
    border-radius: 50rem;
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.guest-header-signin-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--bs-primary-rgb), 0.55);
    filter: brightness(1.1);
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .guest-netflix-hero {
        min-height: 75vh;
        padding-top: 80px;
        padding-bottom: 40px;
    }

    .guest-hero-title {
        font-size: 2.1rem;
    }

    .guest-hero-subtitle {
        font-size: 1.15rem;
    }

    .streamit-cta-input-group {
        border-radius: 16px;
        flex-direction: column;
        padding: 8px;
    }

    .streamit-cta-icon {
        display: none;
    }

    .streamit-cta-input {
        text-align: center;
        height: 50px;
        font-size: 1.05rem;
        padding: 0 1rem;
    }

    .streamit-cta-btn {
        width: 100%;
        border-radius: 12px !important;
        height: 50px;
        margin-top: 6px;
    }
}

/* ========================================================================= */
/* PWA Guest Landing Mode Visibility Guard                                   */
/* ========================================================================= */
.guest-pwa-experience,
.pwa-only-experience {
    display: none !important;
}

.guest-web-experience {
    display: block;
}

html.is-pwa-standalone .guest-web-experience,
body.is-pwa-standalone .guest-web-experience {
    display: none !important;
}

html.is-pwa-standalone .guest-pwa-experience,
body.is-pwa-standalone .guest-pwa-experience {
    display: block !important;
}

@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
    .guest-web-experience {
        display: none !important;
    }
    .guest-pwa-experience,
    .pwa-only-experience {
        display: block !important;
    }
}


