/* ============================================================
   Login modern v2 — 2026-05-16
   Used by: loginform / restorepass / restorepass_requestsent /
            restorepass_reset (wrapped by loginpage.tpl.php)
   ============================================================ */

:root {
    --login-primary: #1e24f5;
    --login-primary-dark: #1518c4;
    --login-primary-tint: rgba(30, 36, 245, 0.08);
    --login-text-dark: #1a1a2e;
    --login-text-muted: #6b7280;
    --login-border: #e5e7eb;
    --login-input-bg: #f9fafb;
    --login-overlay-from: rgba(20, 24, 60, 0.55);
    --login-overlay-to: rgba(30, 36, 245, 0.45);
}

body.login-page {
    margin: 0;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--login-text-dark);
    background: #fff;
}

/* Hide legacy preloader on modern login */
body.login-page .loader { display: none; }

.login-shell {
    display: flex;
    min-height: 100vh;
}

/* ============ LEFT : FORM ============ */
.login-form-side {
    flex: 0 0 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: #fff;
}

.login-form-inner {
    width: 100%;
    max-width: 420px;
}

.login-logo {
    margin-bottom: 48px;
}
.login-logo img {
    max-height: 48px;
    max-width: 200px;
    display: block;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
    color: var(--login-text-dark);
}
.login-subtitle {
    color: var(--login-text-muted);
    margin: 0 0 32px;
    font-size: 15px;
    line-height: 1.5;
}

.login-msg {
    margin: 0 0 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
}
.login-msg:empty { display: none; }
.login-msg.error,
.login-msg.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.login-msg.success,
.login-msg.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.login-form .form-group {
    margin-bottom: 20px;
}
.login-form .form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--login-text-dark);
}
.login-form .form-control {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    font-size: 15px;
    border: 1.5px solid var(--login-border);
    border-radius: 10px;
    background: var(--login-input-bg);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    color: var(--login-text-dark);
}
.login-form .form-control:focus {
    outline: none;
    border-color: var(--login-primary);
    background: #fff;
    box-shadow: 0 0 0 4px var(--login-primary-tint);
}
.login-form .form-control::placeholder {
    color: #9ca3af;
}

/* Password input + reveal */
.login-form .password-wrap {
    position: relative;
}
.login-form .password-wrap .form-control {
    padding-right: 48px;
}
.login-form .password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--login-text-muted);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 16px;
    transition: color 0.15s ease, background 0.15s ease;
}
.login-form .password-toggle:hover {
    color: var(--login-primary);
    background: var(--login-primary-tint);
}
.login-form .password-toggle:focus {
    outline: 2px solid var(--login-primary);
    outline-offset: 2px;
}

.login-form .form-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 28px;
    font-size: 14px;
    gap: 12px;
    flex-wrap: wrap;
}
.login-form .form-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--login-text-muted);
    margin: 0;
}
.login-form .form-check input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: var(--login-primary);
    cursor: pointer;
    margin: 0;
}
.login-form .forgot-link {
    color: var(--login-primary);
    text-decoration: none;
    font-weight: 500;
}
.login-form .forgot-link:hover {
    text-decoration: underline;
}

.login-form .btn-login {
    width: 100%;
    height: 48px;
    border: none;
    background: var(--login-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}
.login-form .btn-login:hover {
    background: var(--login-primary-dark);
}
.login-form .btn-login:active {
    transform: translateY(1px);
}

.login-footer {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--login-text-muted);
    gap: 12px;
}
.login-footer .lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.login-footer .lang-switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--login-border);
    text-decoration: none;
    padding: 0;
}
.login-footer .lang-switch a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.login-footer .lang-switch a.active {
    border-color: var(--login-primary);
    box-shadow: 0 0 0 2px var(--login-primary-tint);
}

/* Info box used by restorepass_requestsent + restorepass_reset */
.login-info-box {
    background: var(--login-primary-tint);
    border-left: 3px solid var(--login-primary);
    padding: 16px 18px;
    border-radius: 8px;
    margin: 8px 0 24px;
}
.login-info-box h4 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    color: var(--login-text-dark);
}
.login-info-box p {
    margin: 0;
    font-size: 14px;
    color: var(--login-text-muted);
    line-height: 1.5;
}
.login-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--login-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.login-back-link:hover {
    text-decoration: underline;
}

/* ============ RIGHT : VISUAL ============ */
.login-visual-side {
    flex: 0 0 50%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #14183c 0%, #1e24f5 100%);
}
.login-visual-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.login-visual-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--login-overlay-from) 0%, var(--login-overlay-to) 100%);
}
.login-visual-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px 56px;
    color: #fff;
}
.visual-title {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 16px;
    letter-spacing: -1px;
    max-width: 480px;
}
.visual-subtitle {
    font-size: 17px;
    line-height: 1.5;
    margin: 0 0 36px;
    opacity: 0.92;
    max-width: 460px;
    font-weight: 300;
}
.visual-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 460px;
}
.visual-bullets li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 15px;
    line-height: 1.5;
}
.visual-bullets .bullet-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    margin-top: 1px;
}
.visual-footer {
    position: absolute;
    bottom: 32px;
    left: 56px;
    right: 56px;
    z-index: 2;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.visual-footer a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    margin-left: 16px;
}
.visual-footer a:hover { color: #fff; }

/* ============ MOBILE / TABLETTE ============ */
@media (max-width: 991px) {
    .login-visual-side { display: none; }
    .login-form-side {
        flex: 1 1 100%;
        padding: 40px 20px;
    }
    .login-form-inner { max-width: 420px; }
    .login-logo { margin-bottom: 36px; }
    .login-title { font-size: 24px; }
}

@media (max-width: 480px) {
    .login-form-side { padding: 24px 16px; }
    .login-title { font-size: 22px; }
    .login-subtitle { font-size: 14px; }
}
