/* --------------------------------------------------------------------------
   Navbar Brand Entrance Orchestration (Landing Page Exclusive)
   -------------------------------------------------------------------------- */

/* 1. Squircle Mark: Spring scale-in with deblur */
@keyframes brandLogoEntrance {
    from {
        opacity: 0;
        filter: blur(5px);
        transform: scale(0.82);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

/* 2. Logotype: Slides out from under the squircle mark */
@keyframes brandLogotypeEntrance {
    from {
        opacity: 0;
        filter: blur(4px);
        transform: translateX(18px) translateY(2px);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateX(0) translateY(2px);
    }
}

/* 3. Hairline Divider: Drops open vertically */
@keyframes brandDividerEntrance {
    from {
        opacity: 0;
        transform: scaleY(0);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* 4. Tagline: Unmasks from the divider right-to-left */
@keyframes brandTaglineWipe {
    from {
        opacity: 0;
        filter: blur(4px);
        transform: translateX(10px);
        clip-path: inset(0 0 0 100%);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateX(0);
        clip-path: inset(0 0 0 0);
    }
}

/* Scoped exclusively to the landing shell header */
.landing-page-shell .navbar-fullwidth .logo-mark {
    animation: brandLogoEntrance 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.05s backwards;
}

.landing-page-shell .navbar-fullwidth .brand-logotype {
    animation: brandLogotypeEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.22s backwards;
}

.landing-page-shell .navbar-fullwidth .brand-divider {
    transform-origin: center;
    animation: brandDividerEntrance 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.48s backwards;
}

.landing-page-shell .navbar-fullwidth .brand-tagline {
    animation: brandTaglineWipe 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.58s backwards;
}

/* --------------------------------------------------------------------------
   Page Mount & Staggered Entrance Orchestration with Deblur Focus
   -------------------------------------------------------------------------- */
@keyframes heroElementEntrance {
    from {
        opacity: 0;
        filter: blur(6px);
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* Retains the -32px optical anchor while focusing in from 5px blur */
@keyframes heroTitleEntrance {
    from {
        opacity: 0;
        filter: blur(8px);
        transform: translateX(-32px) translateY(14px);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateX(-32px) translateY(0);
    }
}

@keyframes glowEntrance {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.65;
    }
}

/* ==========================================================================
   Rasta Landing Page - Polished SaaS Layout
   ========================================================================== */

.landing-page-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: hidden;
    background-color: var(--bg-main);
}

/* Ambient Radial Glows */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.65;
    animation: glowEntrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.glow-top {
    width: 650px;
    height: 380px;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(37, 99, 235, 0.16) 0%, rgba(239, 246, 255, 0) 70%);
}

.glow-bottom {
    width: 500px;
    height: 320px;
    bottom: 50px;
    right: -100px;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.14) 0%, rgba(255, 255, 255, 0) 70%);
}

/* --------------------------------------------------------------------------
   3. Hero Section
   -------------------------------------------------------------------------- */
.hero-container {
    position: relative;
    z-index: 1;
    max-width: 920px;
    margin: 0 auto;
    padding: 72px 24px 64px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 18px;
    background: rgba(239, 246, 255, 0.9);
    border: 1px solid #bfdbfe;
    color: #1e40af;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 28px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
    animation: heroElementEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.12s backwards;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Subtle Hairline Separator */
.hero-badge-divider {
    width: 1px;
    height: 14px;
    background-color: #93c5fd;
    margin: 0 3px;
    opacity: 0.8;
}

/* Integrated Live Counter Label */
.badge-online {
    color: #1d4ed8;
    font-weight: 700;
    white-space: nowrap;
}

/* Mobile wrap safety for narrow viewports */
@media (max-width: 480px) {
    .hero-badge {
        flex-wrap: wrap;
        justify-content: center;
        padding: 8px 14px;
        gap: 8px;
    }

    .hero-badge-divider {
        display: none;
    }
}

.hero-title {
    font-size: clamp(2.35rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.45;
    margin: 0 auto 24px;
    color: #0b1329;
    transform: translateX(-32px); /* Tweak this value to nudge left (-) or right (+) */
    animation: heroTitleEntrance 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.22s backwards;
}

/* Rotator Wrapper: Fixed Anchor Slot (Pinned to Right, Zero Center Shifting) */
.rotator-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
    direction: rtl;
    vertical-align: baseline;
}

/* Masking stage: Completely open horizontally so letters never clip */
.word-stage {
    position: relative;
    display: block;
    width: 100%;
    overflow: visible;
    clip-path: inset(-40px -80px 0px -80px);
    padding: 2px 0;
}

.rotating-word {
    display: inline-block;
    width: auto;
    white-space: nowrap;
    text-align: right;
    font-weight: 900;
    font-variation-settings: 'wght' 900;
    color: var(--primary);
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    will-change: transform, opacity, filter;
}

/* Exit: Accelerates upward with slight blur */
.rotating-word.anim-exit {
    animation: surgeExit 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes surgeExit {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
    to {
        transform: translateY(-50%) scale(0.96);
        opacity: 0;
        filter: blur(3px);
    }
}

/* Enter: Surges in smoothly with physical inertia */
.rotating-word.anim-enter {
    animation: surgeFromUnderline 0.38s cubic-bezier(0.16, 1.25, 0.28, 1) forwards;
}

@keyframes surgeFromUnderline {
    from {
        transform: translateY(110%) scale(0.94);
        opacity: 0;
        filter: blur(2px);
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

.hero-desc {
    max-width: 680px;
    margin: 0 auto 40px;
    color: var(--text-muted);
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.85;
    animation: heroElementEntrance 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.32s backwards;
}

/* --- Primary Hero CTA & Status Badge --- */
.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 56px;
    animation: heroElementEntrance 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.42s backwards;
}

/* --- Flat Hero CTA Button --- */
.btn-hero-primary {
    position: relative;
    height: 50px;
    padding-right: 34px;
    padding-left: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--primary-light);
    color: #ffffff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm, 10px);
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.btn-hero-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08), 0 6px 14px rgba(15, 23, 42, 0.06);
}

.btn-hero-primary:active {
    background-color: #1e40af;
    transform: translateY(0) scale(0.985);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.btn-hero-text {
    position: relative;
    z-index: 1;
    line-height: 1;
    transform: translateY(1px);
}

.btn-arrow-icon {
    position: relative;
    z-index: 1;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    display: block;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-hero-primary:hover .btn-arrow-icon {
    transform: translateX(-3px);
}

.hero-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.status-indicator-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
}

/* Metric Counters Strip */
.stats-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(226, 232, 240, 0.85);
    backdrop-filter: blur(10px);
    padding: 16px 36px;
    border-radius: var(--radius-md);
    max-width: 640px;
    width: 100%;
    animation: heroElementEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.52s backwards;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-number {
    font-size: 1.45rem;
    font-weight: 900;
    color: #0f172a;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border-subtle);
}

.copyright-text {
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
    .ambient-glow,
    .hero-badge,
    .hero-title,
    .hero-desc,
    .hero-actions,
    .stats-strip,
    .landing-page-shell .navbar-fullwidth .logo-mark,
    .landing-page-shell .navbar-fullwidth .brand-logotype,
    .landing-page-shell .navbar-fullwidth .brand-divider,
    .landing-page-shell .navbar-fullwidth .brand-tagline {
        animation: none !important;
        opacity: 1 !important;
        filter: none !important;
        transform: none !important;
        clip-path: none !important;
    }
    .hero-title {
        transform: translateX(-32px) !important;
    }
    .landing-page-shell .navbar-fullwidth .brand-logotype {
        transform: translateY(2px) !important;
    }
}

/* Modal Backdrop */
.auth-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.auth-modal-card {
    background-color: var(--surface);
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    /* Caps modal to 90% viewport height and enables elastic flex layout */
    max-height: min(90dvh, 720px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
    overflow: hidden;
}

.auth-card-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.auth-title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.auth-subtitle { font-size: 0.825rem; color: #64748b; margin: 0.25rem 0 0; }
.auth-close-btn {
    background: none; border: none; font-size: 1.5rem; line-height: 1;
    color: #94a3b8; cursor: pointer; padding: 0.25rem;
}
.auth-close-btn:hover { color: #0f172a; }

/* Nav Tabs */
.auth-nav-tabs {
    flex-shrink: 0;
    display: flex;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-main);
}
.auth-nav-btn {
    flex: 1;
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 500;
    border: none;
    background: none;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}
.auth-nav-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background-color: var(--surface);
    font-weight: 600;
}

/* Scrollable Form Body */
.auth-pane {
    display: none;
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.auth-pane.active { display: block; }

/* Subtle Webkit Scrollbar */
.auth-pane::-webkit-scrollbar {
    width: 5px;
}
.auth-pane::-webkit-scrollbar-track {
    background: transparent;
}
.auth-pane::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 9999px;
}
.auth-pane::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* Forms & Choice Pills */
.form-group { margin-bottom: 0.85rem; }
.form-row { display: flex; gap: 0.75rem; }
.col-6 { flex: 1; }

/* Asymmetrical OTP & Password Row */
#candOtpGroup,
#instOtpGroup {
    flex: 0 0 125px; /* Compact dedicated width for 5-digit code */
}
#candOtpGroup + .col-6,
#instOtpGroup + .col-6 {
    flex: 1; /* Password input expands to fill all remaining width */
}

/* Ensure OTP inputs have identical visuals */
#candOtpCode,
#instOtpCode {
    font-family: inherit;
    font-size: 0.9rem;
    letter-spacing: normal;
    text-align: center;
}

.form-label { display: block; font-size: 0.825rem; font-weight: 600; margin-bottom: 0.35rem; }
.form-control {
    width: 100%;
    height: 42px;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2); }
.form-control.uppercase { text-transform: uppercase; }

.segmented-choice {
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 8px;
}
.choice-pill, .switch-chip {
    flex: 1;
    text-align: center;
    cursor: pointer;
    user-select: none;
}
.choice-pill input, .switch-chip input { display: none; }
.choice-pill span, .switch-chip span {
    display: block;
    padding: 0.38rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s ease;
}
.choice-pill input:checked + span, .switch-chip input:checked + span {
    background-color: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 700;
}

.auth-login-type-switch {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.15rem;
}

.input-with-button { display: flex; gap: 0.5rem; }
.auth-alert-box {
    margin: 1rem 1.5rem 0;
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    font-size: 0.825rem;
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.badge-verification {
    font-size: 0.8rem;
    margin-top: 0.35rem;
    font-weight: 600;
}
.badge-verification.valid { color: #15803d; }
.badge-verification.invalid { color: #b91c1c; }

.auth-link-text {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s ease;
}
.auth-link-text:hover {
    text-decoration: underline;
    opacity: 0.85;
}
