/* ── Language switcher ── */
.cl-lang-switcher {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: inline-flex;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--cl-neutral-4);
    border-radius: 50px;
    padding: 3px;
    gap: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cl-lang-opt {
    border: none;
    background: transparent;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: var(--cl-neutral-3);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.cl-lang-opt:hover {
    color: var(--cl-neutral-1);
}

.cl-lang-opt.active {
    background: var(--cl-purple-1);
    color: #fff;
}

.fp-mode .cl-lang-opt.active {
    background: linear-gradient(135deg, #ff5c3e, #ff62d7);
}

[data-theme-mode="dark"] .cl-lang-switcher {
    background: rgba(42, 37, 48, 0.95);
    border-color: #3e1f65;
}

/* ── Login page overrides ── */
.cl-login-cover {
    background: linear-gradient(135deg, #3e1f65, #7d30e0, #a899fd, #3e1f65);
    background-size: 300% 300%;
    animation: clGradShift 14s ease infinite;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

@keyframes clGradShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Animated gradient blobs */
.cl-grad-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    opacity: 0.4;
    pointer-events: none;
}

.cl-grad-blob-1 {
    width: 480px;
    height: 480px;
    background: linear-gradient(135deg, #7d30e0, #2495ff);
    /* Takeoff */
    top: -140px;
    right: -100px;
    animation: blobFloat1 18s ease-in-out infinite;
}

.cl-grad-blob-2 {
    width: 340px;
    height: 340px;
    background: linear-gradient(135deg, #7d30e0, #ff62d7);
    /* Altitude */
    bottom: -80px;
    left: -80px;
    animation: blobFloat2 22s ease-in-out infinite;
}

.cl-grad-blob-3 {
    width: 260px;
    height: 260px;
    background: linear-gradient(135deg, #2495ff, #a899fd, #ff62d7);
    /* Atmosphere */
    top: 45%;
    left: 25%;
    animation: blobFloat3 16s ease-in-out infinite;
}

@keyframes blobFloat1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-40px, 70px) scale(1.12);
    }

    66% {
        transform: translate(30px, -35px) scale(0.93);
    }
}

@keyframes blobFloat2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    40% {
        transform: translate(65px, -45px) scale(1.18);
    }

    70% {
        transform: translate(-25px, 35px) scale(0.88);
    }
}

@keyframes blobFloat3 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(-55px, -30px) scale(1.22);
    }

    75% {
        transform: translate(45px, 55px) scale(0.82);
    }
}

.cl-login-cover-inner {
    position: relative;
    z-index: 1;
}

.cl-feature-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px 16px;
    backdrop-filter: blur(4px);
    transition: background 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cl-feature-card:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cl-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

/* Form panel */
.cl-form-panel {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.cl-form-wrap {
    width: 100%;
    max-width: 420px;
}

.cl-login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--cl-neutral-3);
    font-size: 13px;
    margin: 24px 0;
}

.cl-login-divider::before,
.cl-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--cl-neutral-4);
}

/* Input sizing */
.form-control-lg {
    border-radius: var(--cl-radius-button) !important;
}

.btn-lg {
    border-radius: var(--cl-radius-button) !important;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Dark mode adjustments */
[data-theme-mode="dark"] .cl-form-panel {
    background-color: #1a1625;
}

[data-theme-mode="dark"] body {
    background-color: #1a1625 !important;
}

/* Wordmark text fallback (if logo image not available) */
.cl-wordmark {
    font-size: 28px;
    font-weight: 800;
    color: var(--cl-purple-1);
    letter-spacing: -0.5px;
}

.cl-wordmark-white {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

/* Badge pill for version */
.cl-version-badge {
    background: var(--cl-purple-3);
    color: var(--cl-purple-1);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--cl-radius-pill);
    letter-spacing: 0.5px;
}

/* ── User chip ── */
.cl-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--cl-purple-3);
    border-radius: 50px;
    padding: 6px 16px 6px 6px;
}

.cl-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--cl-purple-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.cl-user-chip-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--cl-purple-1);
}

/* ── Custom select ── */
.cl-select-wrapper {
    position: relative;
}

.cl-select-wrapper .cl-select-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cl-neutral-3);
    pointer-events: none;
    font-size: 16px;
    z-index: 2;
}

.cl-env-select {
    width: 100%;
    height: 52px;
    padding: 0 44px 0 44px;
    border: 1.5px solid var(--cl-neutral-4);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--cl-neutral-1);
    background-color: #fff;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b6b1bd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.cl-env-select:focus {
    outline: none;
    border-color: var(--cl-purple-1);
    box-shadow: 0 0 0 3px rgba(125, 48, 224, 0.12);
}

.cl-env-select option {
    font-size: 14px;
    font-weight: 400;
    padding: 8px;
}

[data-theme-mode="dark"] .cl-env-select {
    background-color: #2a2530;
    border-color: #3e1f65;
    color: var(--cl-neutral-5);
}

/* ── Selected environment preview ── */
.cl-env-preview {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--cl-purple-3);
    border-radius: 12px;
    margin-top: 12px;
    animation: fadeIn 0.2s ease;
}

.cl-env-preview.visible { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cl-env-preview-logo {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.cl-env-preview-role {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--cl-purple-1);
    background: rgba(125, 48, 224, 0.12);
    border-radius: 50px;
    padding: 2px 10px;
}

[data-theme-mode="dark"] .cl-env-preview {
    background: rgba(125, 48, 224, 0.12);
}

/* ── Buttons ── */
.btn-lg { border-radius: 8px !important; font-weight: 600; }

[data-theme-mode="dark"] .cl-form-panel { background-color: #1a1625; }
[data-theme-mode="dark"] body           { background-color: #1a1625 !important; }

/* ══════════════════════════════════════════
   Forgot Password — Orange/pink theme override
   (colors from forgot-password.html prototype)
   ══════════════════════════════════════════ */
.fp-mode .cl-login-cover {
    background-image: linear-gradient(135deg, #b02a15, #ff5c3e, #ff62d7, #b02a15) !important;
    background-size: 300% 300%;
    animation: clGradShift 14s ease infinite;
}
.fp-mode .cl-grad-blob-1 { background: linear-gradient(135deg, #ff5c3e, #ff62d7) !important; }
.fp-mode .cl-grad-blob-2 { background: linear-gradient(135deg, #ff62d7, #ffc2b7) !important; }
.fp-mode .cl-grad-blob-3 { background: linear-gradient(135deg, #ff5c3e, #ffd4f4, #ff62d7) !important; }

.fp-mode .cl-step-dot.active { background: var(--cl-orange-main); }
.fp-mode .cl-step-dot.done   { background: var(--cl-pink-main); }

.fp-mode .cl-otp-input:focus { border-color: var(--cl-orange-main); box-shadow: 0 0 0 3px rgba(255,92,62,0.15); }
.fp-mode .cl-otp-input.filled { border-color: var(--cl-pink-main); background: var(--cl-pink-light); color: #c0356a; }
.fp-mode .cl-otp-input { caret-color: var(--cl-orange-main); }

.fp-mode .cl-email-badge { background: var(--cl-orange-light); color: #b83a22; }

.fp-mode .cl-resend-link { color: var(--cl-orange-main); }

.fp-mode .btn-primary {
    background: linear-gradient(135deg, #ff5c3e, #ff62d7) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(255, 92, 62, 0.35);
}
.fp-mode .btn-primary:hover {
    background: linear-gradient(135deg, #e84d31, #e854c0) !important;
    border-color: transparent !important;
}
.fp-mode .btn-primary:disabled {
    background: var(--cl-neutral-4) !important;
    color: var(--cl-neutral-3) !important;
    box-shadow: none;
}

.fp-mode .cl-env-select:focus { border-color: var(--cl-orange-main); box-shadow: 0 0 0 3px rgba(255,92,62,0.12); }

[data-theme-mode="dark"] .fp-mode .cl-otp-input.filled { background: rgba(255,98,215,0.18); color: var(--cl-pink-main); }

/* ══════════════════════════════════════════
   Forgot Password — Step transitions
   ══════════════════════════════════════════ */
.cl-step { display: none; animation: stepIn 0.28s ease; }
.cl-step.active { display: block; }
@keyframes stepIn {
    from { opacity: 0; transform: translateX(18px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Step progress dots */
.cl-step-dots { display: flex; align-items: center; gap: 8px; margin-bottom: 32px; }
.cl-step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cl-neutral-4); transition: all 0.25s ease; }
.cl-step-dot.active { background: var(--cl-purple-1); width: 24px; border-radius: 4px; }
.cl-step-dot.done { background: var(--cl-purple-4); }

/* OTP input row */
.cl-otp-row { display: flex; gap: 10px; justify-content: center; margin: 8px 0 4px; }
.cl-otp-input {
    width: 52px; height: 60px; text-align: center;
    font-size: 24px; font-weight: 700; font-family: inherit;
    color: var(--cl-neutral-1);
    border: 1.5px solid var(--cl-neutral-4); border-radius: 12px;
    background: #fff; caret-color: var(--cl-purple-1);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    outline: none; -moz-appearance: textfield;
}
.cl-otp-input::-webkit-outer-spin-button,
.cl-otp-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cl-otp-input:focus { border-color: var(--cl-purple-1); box-shadow: 0 0 0 3px rgba(125,48,224,0.15); }
.cl-otp-input.filled { border-color: var(--cl-purple-4); background: var(--cl-purple-3); color: var(--cl-purple-2); }
.cl-otp-input.error { border-color: var(--cl-red-main); background: var(--cl-red-light); animation: shake 0.35s ease; }
@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-6px); }
    60%     { transform: translateX(6px); }
    80%     { transform: translateX(-3px); }
}
[data-theme-mode="dark"] .cl-otp-input { background: #2a2530; border-color: #3e1f65; color: var(--cl-neutral-5); }
[data-theme-mode="dark"] .cl-otp-input.filled { background: rgba(168,153,253,0.18); color: var(--cl-purple-4); }

/* Resend timer */
.cl-resend-row { text-align: center; margin-top: 16px; font-size: 13px; color: var(--cl-neutral-3); }
.cl-resend-link {
    color: var(--cl-purple-1); text-decoration: none; font-weight: 500; cursor: pointer;
    background: none; border: none; padding: 0; font-family: inherit; font-size: 13px;
}
.cl-resend-link:disabled { color: var(--cl-neutral-3); cursor: default; }

/* Email badge */
.cl-email-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--cl-purple-3); color: var(--cl-purple-1);
    border-radius: 8px; padding: 8px 14px; font-size: 14px; font-weight: 500;
    margin: 12px 0 20px; word-break: break-all;
}

/* Password strength bar */
.cl-strength-bar { height: 4px; border-radius: 2px; background: var(--cl-neutral-4); margin-top: 8px; overflow: hidden; }
.cl-strength-fill { height: 100%; border-radius: 2px; width: 0%; transition: width 0.3s ease, background 0.3s ease; }
.cl-strength-label { font-size: 12px; margin-top: 4px; font-weight: 500; }

/* Success icon */
.cl-success-icon {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--cl-green-light);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}