/* ── Login page (isolated from app shell) ───────────────────── */

body:has(.cv-login-page) {
    overflow: hidden;
    background: #060b18 !important;
}

.cv-login-page {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: #060b18;
    font-family: 'Inter', system-ui, sans-serif;
    color: #f1f5f9;
    overflow: hidden;
    box-sizing: border-box;
}

.cv-login-page *,
.cv-login-page *::before,
.cv-login-page *::after {
    box-sizing: border-box;
}

#cv-login-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.cv-login-orbs {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.cv-login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: cv-login-orb-float 18s ease-in-out infinite;
}

.cv-login-orb--1 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, #2563eb 0%, transparent 70%);
    top: -8%;
    left: -6%;
}

.cv-login-orb--2 {
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
    bottom: -10%;
    right: -4%;
    animation-delay: -6s;
}

.cv-login-orb--3 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
    top: 40%;
    right: 18%;
    animation-delay: -12s;
    opacity: 0.28;
}

@keyframes cv-login-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(28px, -20px) scale(1.06); }
    66%       { transform: translate(-18px, 24px) scale(0.94); }
}

.cv-login-card-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    animation: cv-login-fade-up 0.6s ease both;
}

.cv-login-lang {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}
.cv-login-lang .cv-lang-btn {
    background: rgba(15, 23, 42, 0.55);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 12px;
}
.cv-login-lang .cv-lang-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.cv-login-card {
    position: relative;
    width: 100%;
    padding: 36px 32px 32px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform-origin: center center;
    transition: box-shadow 0.3s ease;
}

.cv-login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.18), transparent 40%, rgba(96,165,250,0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.cv-login-card-header {
    text-align: center;
    margin-bottom: 28px;
}

.cv-login-logo {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 24px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.cv-login-card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0 0 4px;
    line-height: 1.3;
}

.cv-login-card-header span {
    display: block;
    font-size: 13px;
    color: #64748b;
}

.cv-login-alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.45;
}

.cv-login-alert--success {
    color: #86efac;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.cv-login-alert--danger {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.cv-login-alert--warning {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

#cv-login-form {
    margin: 0;
}

.cv-login-field {
    margin-bottom: 20px;
}

.cv-login-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.cv-login-input-wrap {
    position: relative;
    display: block;
}

.cv-login-input-wrap i.cv-login-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 15px;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s ease;
}

.cv-login-input-wrap input {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 12px 44px 12px 42px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(2, 6, 23, 0.65);
    color: #f1f5f9;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.cv-login-input-wrap input::placeholder {
    color: #475569;
    opacity: 1;
}

.cv-login-input-wrap input:-webkit-autofill,
.cv-login-input-wrap input:-webkit-autofill:hover,
.cv-login-input-wrap input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f1f5f9;
    -webkit-box-shadow: 0 0 0 1000px rgba(2, 6, 23, 0.9) inset;
    transition: background-color 5000s ease-in-out 0s;
}

.cv-login-input-wrap input:focus {
    border-color: rgba(96, 165, 250, 0.6);
    background: rgba(2, 6, 23, 0.85);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cv-login-input-wrap:focus-within i.cv-login-input-icon {
    color: #60a5fa;
}

.cv-login-input-glow {
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #3b82f6, #8b5cf6, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.cv-login-input-wrap:focus-within .cv-login-input-glow {
    opacity: 1;
}

.cv-login-toggle-pw {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #64748b;
    padding: 6px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: color 0.2s ease;
}

.cv-login-toggle-pw:hover {
    color: #94a3b8;
}

.cv-login-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.cv-login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #2563eb;
    cursor: pointer;
    flex-shrink: 0;
}

.cv-login-remember label {
    font-size: 13px;
    color: #94a3b8;
    cursor: pointer;
    margin: 0;
    line-height: 1.4;
}

.cv-login-recaptcha-notice {
    margin: 0.75rem 0 0;
    font-size: 11px;
    line-height: 1.45;
    color: #64748b;
    text-align: center;
}

.cv-login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cv-login-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
}

.cv-login-submit:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.cv-login-submit:disabled {
    opacity: 0.75;
    cursor: wait;
}

.cv-login-submit-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cv-login-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cv-login-spin 0.7s linear infinite;
    display: none;
}

.cv-login-submit.is-loading .cv-login-spinner { display: inline-block; }

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

@keyframes cv-login-fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .cv-login-card {
        padding: 28px 22px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cv-login-orb { animation: none !important; }
    .cv-login-card { transform: none !important; }
    .cv-login-card-wrap { animation: none !important; }
}
