/* =============================================================
   AltDeliver – Login page styles
   ============================================================= */

.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 60px;
    position: relative;
}

.login-main::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(ellipse, rgba(6, 159, 214, 0.10) 0%, transparent 70%);
    pointer-events: none;
}

/* ── Card ────────────────────────────────────────────────────── */
.login-card {
    width: 100%;
    max-width: 440px;
    padding: 48px 44px;
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    box-shadow: 0 12px 60px rgba(0, 0, 0, 0.30), 0 0 0 1px rgba(255, 255, 255, 0.04);
    position: relative;
    z-index: 1;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(6, 159, 214, 0.55), transparent);
}

/* ── Branding ─────────────────────────────────────────────────── */
.login-brand {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    height: 38px;
    width: auto;
}

.login-heading {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-align: center;
    letter-spacing: -0.02em;
}

.login-sub {
    font-size: 13.5px;
    color: var(--text-muted-glass);
    text-align: center;
    margin-bottom: 36px;
    line-height: 1.5;
}

/* ── Form fields ─────────────────────────────────────────────── */
.login-form .form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.forgot-link {
    font-size: 12px;
    color: var(--cyan);
    text-decoration: none;
    font-weight: 500;
    opacity: 0.85;
    transition: opacity 0.18s;
}

.forgot-link:hover {
    opacity: 1;
}

.password-wrap {
    position: relative;
}

.password-wrap .form-control {
    padding-right: 46px;
}

/* ── Remember me ─────────────────────────────────────────────── */
.login-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-check .form-check-input {
    margin: 0;
    cursor: pointer;
}

.login-check .form-check-label {
    font-size: 13px;
    color: var(--text-muted-glass);
    cursor: pointer;
}

/* ── Divider ─────────────────────────────────────────────────── */
.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 28px 0;
    color: var(--text-muted-glass);
    font-size: 12px;
}

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

/* ── Bottom link ─────────────────────────────────────────────── */
.login-signup-link {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted-glass);
    margin-top: 28px;
    margin-bottom: 0;
}

.login-signup-link a {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.18s;
}

.login-signup-link a:hover {
    opacity: 0.8;
}

/* ── Loading animation ───────────────────────────────────────── */
.loading-animation {
    display: none;
    text-align: center;
    padding: 4px 0 16px;
}

.loading-animation::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--glass-border);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: auth-spin 0.65s linear infinite;
}

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

/* ── Password strength bar ───────────────────────────────────── */
.password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.strength-track {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--glass-border);
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 2px;
    width: 0%;
    transition: width 0.28s ease, background 0.28s ease;
}

.strength-label {
    font-size: 11px;
    font-weight: 600;
    min-width: 42px;
    text-align: right;
    transition: color 0.28s ease;
}

/* ── Auth banners (site.js ShowBanner / ClearBanners targets) ──── */
.login-card .alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 24px;
    line-height: 1.4;
    box-shadow: none;
}

.login-card .alert i {
    flex-shrink: 0;
    margin-top: 2px;
}

.login-card .alert-success {
    background: rgba(0, 212, 170, 0.10);
    border: 1px solid rgba(0, 212, 170, 0.22);
    color: var(--green);
}

.login-card .alert-warning {
    background: rgba(255, 169, 64, 0.10);
    border: 1px solid rgba(255, 169, 64, 0.22);
    color: #ffa940;
}

.login-card .alert-danger {
    background: rgba(255, 80, 80, 0.10);
    border: 1px solid rgba(255, 80, 80, 0.22);
    color: #ff6b6b;
}

/* ── Light mode ──────────────────────────────────────────────── */
:root[data-theme="light"] .login-card {
    box-shadow: 0 12px 60px rgba(0, 0, 0, 0.10), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .login-main::before {
    background: radial-gradient(ellipse, rgba(6, 159, 214, 0.07) 0%, transparent 70%);
}

/* ── Full-width button centering (w-100 variant) ─────────────── */
.btn-glow.w-100 {
    justify-content: center;
}

/* ── Register page wide card ─────────────────────────────────── */
.login-main--top {
    align-items: flex-start;
    padding-top: 60px;
}

.login-card--wide {
    max-width: 560px;
    width: 100%;
}

/* ── TOS acceptance ───────────────────────────────────────────── */
.tos-note {
    font-size: 13px;
}

.tos-required {
    color: #ff6b6b;
    font-weight: 700;
}

.tos-radio-hidden {
    visibility: hidden;
    position: absolute;
}

.tos-modal-body {
    max-height: 60vh;
    overflow-y: scroll;
}

/* ── Field validation errors ─────────────────────────────────── */
.field-error {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 6px;
}

/* ── Back-to-sign-in link icon ───────────────────────────────── */
.login-back-icon {
    font-size: 10px;
    margin-right: 4px;
}

/* ── Expired-link action row (recover.php) ───────────────────── */
.login-expired-actions {
    text-align: center;
    margin-top: 24px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .login-card {
        padding: 36px 24px;
    }

    .login-main {
        padding: 60px 16px 40px;
        align-items: flex-start;
    }
}
