/* ═══════════════════════════════════════════
   BoS VPN — Login Page Styles
   Extends style.css design system
   ═══════════════════════════════════════════ */

/* ── Page Layout ── */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-h) + 48px) 24px 48px;
}

/* ── Login Card ── */
.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.login-card::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
    pointer-events: none;
}

.login-card::after {
    content: '';
    position: absolute;
    bottom: -120px;
    left: -120px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(236,179,54,0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* ── Step Visibility ── */
.step {
    display: none;
}

.step.active {
    display: block;
    animation: stepFadeIn 0.35s ease-out;
}

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

/* ── Typography ── */
.login-title {
    font-size: 26px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    color: var(--text);
}

.login-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 36px;
    line-height: 1.6;
}

.login-subtitle span {
    color: var(--accent);
    font-weight: 600;
}

/* ── Form Elements ── */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
    text-align: center;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
    background: var(--bg-surface);
}

.form-input::placeholder {
    color: var(--text-muted);
    letter-spacing: normal;
}

.form-error {
    font-size: 13px;
    color: #EF4444;
    margin-top: 10px;
    text-align: center;
    display: none;
}

.form-error.show {
    display: block;
}

/* ── Code Inputs ── */
.code-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.code-input {
    width: 50px;
    height: 60px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    font-family: inherit;
    transition: var(--transition);
    caret-color: var(--accent);
}

.code-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
    background: var(--bg-surface);
}

/* ── Buttons ── */
.login-card .btn {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.login-card .btn-primary {
    background: var(--accent);
    color: #0F172A;
}

.login-card .btn-primary:hover {
    background: #f0be4d;
    box-shadow: 0 8px 32px var(--accent-glow);
    transform: translateY(-2px);
}

.login-card .btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-card .btn-primary:disabled:hover {
    background: var(--accent);
    transform: none;
    box-shadow: none;
}

/* ── Spinner ── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(15,23,42,0.2);
    border-top-color: #0F172A;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ── Back Button ── */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 24px;
    transition: color var(--transition);
    border: none;
    background: none;
    padding: 0;
}

.back-btn:hover {
    color: var(--text);
}

.back-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Timer & Resend ── */
.timer {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 20px;
    line-height: 1.6;
}

.timer span {
    color: var(--accent);
    font-weight: 500;
}

.resend-btn {
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.resend-btn:hover {
    text-decoration: underline;
}

.resend-btn.disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.resend-btn.disabled:hover {
    text-decoration: none;
}

/* ── Success State ── */
.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(34,197,94,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    stroke: #22C55E;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Toast Notifications ── */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    border-color: #EF4444;
    background: rgba(239,68,68,0.1);
    color: #FCA5A5;
}

.toast.success {
    border-color: #22C55E;
    background: rgba(34,197,94,0.1);
    color: #86EFAC;
}

/* ── Footer Link ── */
.login-footer-link {
    text-align: center;
    margin-top: 28px;
}

.login-footer-link a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition);
}

.login-footer-link a:hover {
    color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .login-main {
        padding: calc(var(--header-h) + 24px) 16px 24px;
        align-items: flex-start;
        padding-top: calc(var(--header-h) + 40px);
    }

    .login-card {
        padding: 32px 24px;
        border-radius: var(--radius);
    }

    .login-title {
        font-size: 22px;
    }

    .login-subtitle {
        font-size: 14px;
        margin-bottom: 28px;
    }

    .form-input {
        padding: 14px 16px;
        font-size: 15px;
    }

    .login-card .btn {
        padding: 14px;
        font-size: 15px;
    }

    .code-input {
        width: 44px;
        height: 54px;
        font-size: 22px;
        border-radius: 8px;
    }

    .code-inputs {
        gap: 8px;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 24px 20px;
    }

    .code-input {
        width: 38px;
        height: 48px;
        font-size: 20px;
    }

    .code-inputs {
        gap: 6px;
    }

    .login-title {
        font-size: 20px;
    }
}
