/* Design 2026 des pages d'authentification (login.php, login_code.php, forgot_password.php,
   reset_password.php), encadrées par login_shell_top.php / login_shell_bottom.php.
   Pages autonomes (sans layout.php) : les variables --wt-* viennent de modal_2026.css,
   chargée avant cette feuille. */
:root {
    --wt-page-bg: #eef2f6;
    --wt-danger: #c0453f;
    --wt-dev: #b7791f;
    --wt-dev-soft: #fff8eb;
}

html, body {
    min-height: 100%;
}

body.wt-auth {
    margin: 0;
    background:
        linear-gradient(135deg, #6194c1 0%, var(--wt-accent) 55%, var(--wt-accent-dark) 100%) top / 100% 260px no-repeat,
        var(--wt-page-bg);
    color: var(--wt-ink);
    font-size: 14px;
}

.wt-auth-wrap {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.wt-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--wt-bg);
    border-radius: var(--wt-radius-lg);
    box-shadow: 0 18px 50px rgba(20, 40, 60, .22);
    overflow: hidden;
}

/* ---------- en-tête : logo de l'entité et titre de l'étape ---------- */
.wt-auth-head {
    padding: 28px 32px 20px;
    text-align: center;
    border-bottom: 1px solid var(--wt-line);
}

.wt-auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-bottom: 14px;
}

.wt-auth-logo img {
    max-height: 48px;
    max-width: 220px;
}

.wt-auth-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--wt-ink);
}

.wt-auth-subtitle {
    margin: 4px 0 0;
    color: var(--wt-muted);
    font-size: 13px;
}

/* ---------- corps ---------- */
.wt-auth-body {
    padding: 24px 32px 28px;
}

.wt-auth-body p {
    margin-bottom: 16px;
}

.wt-auth-intro {
    color: var(--wt-muted);
    line-height: 1.5;
}

.wt-auth-field {
    margin-bottom: 16px;
}

.wt-auth-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wt-ink);
}

.wt-auth .form-control {
    height: 42px;
    border: 1px solid var(--wt-line);
    border-radius: var(--wt-radius-sm);
    background: var(--wt-bg);
    color: var(--wt-ink);
    font-size: 15px;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}

.wt-auth .form-control:focus {
    border-color: var(--wt-accent);
    box-shadow: 0 0 0 3px rgba(73, 128, 181, .18);
}

/* captcha : image et saisie côte à côte, même hauteur */
.wt-auth-captcha {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.wt-auth-captcha-img {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 132px;
    height: 42px;
    border: 1px solid var(--wt-line);
    border-radius: var(--wt-radius-sm);
    background: var(--wt-bg-soft);
    overflow: hidden;
}

.wt-auth-captcha-img img {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.wt-auth-captcha .form-control {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* code à 6 chiffres */
.wt-auth .form-control.wt-auth-code-input {
    height: 56px;
    text-align: center;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 10px;
    padding-left: 10px; /* compense l'espacement après le dernier chiffre */
}

.wt-auth .btn-primary.wt-auth-submit {
    display: block;
    width: 100%;
    height: 44px;
    margin-top: 6px;
    border: 0;
    border-radius: var(--wt-radius-sm);
    background: var(--wt-accent);
    font-size: 15px;
    font-weight: 600;
    transition: background .15s;
}

.wt-auth .btn-primary.wt-auth-submit:hover,
.wt-auth .btn-primary.wt-auth-submit:focus {
    background: var(--wt-accent-dark);
}

.wt-auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    font-size: 13px;
}

.wt-auth-links.wt-auth-links-end {
    justify-content: flex-end;
}

.wt-auth-links a {
    color: var(--wt-accent-dark);
}

/* ---------- messages ---------- */
.wt-auth-alert {
    margin-bottom: 18px;
    padding: 10px 14px;
    border-radius: var(--wt-radius-md);
    border-left: 3px solid;
    font-size: 13px;
}

.wt-auth-alert p:last-child {
    margin-bottom: 0;
}

.wt-auth-alert-error {
    border-left-color: var(--wt-danger);
    background: #fbeceb;
    color: #8a2f2a;
}

.wt-auth-alert-success {
    border-left-color: #3f8f5a;
    background: #eaf6ee;
    color: #24613a;
}

/* ---------- code affiché en développement (ENVIRONMENT == 'development') ---------- */
.wt-auth-dev {
    margin-top: 22px;
    padding: 12px 14px;
    border: 1px dashed var(--wt-dev);
    border-radius: var(--wt-radius-md);
    background: var(--wt-dev-soft);
    display: flex;
    align-items: center;
    gap: 12px;
}

.wt-auth-dev-label {
    flex: 1 1 auto;
    font-size: 12px;
    line-height: 1.35;
    color: #7a5212;
}

.wt-auth-dev-label strong {
    display: block;
    text-transform: uppercase;
    letter-spacing: .6px;
    font-size: 11px;
}

.wt-auth-dev-code {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #5c3d0c;
}

.wt-auth-dev-fill {
    flex: 0 0 auto;
    padding: 5px 10px;
    border: 1px solid var(--wt-dev);
    border-radius: var(--wt-radius-xs);
    background: #fff;
    color: #7a5212;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.wt-auth-dev-fill:hover {
    background: var(--wt-dev);
    color: #fff;
}

.wt-auth-foot {
    margin-top: 16px;
    text-align: center;
    color: var(--wt-muted);
    font-size: 12px;
}

@media (max-width: 480px) {
    .wt-auth-head,
    .wt-auth-body {
        padding-left: 20px;
        padding-right: 20px;
    }
}

.wt-auth-captcha .form-control::placeholder {
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
}

/* liste de liens (instances accessibles, no_project_access.php) */
.wt-auth-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    border: 1px solid var(--wt-line);
    border-radius: var(--wt-radius-md);
}

.wt-auth-list li + li {
    border-top: 1px solid var(--wt-line);
}

.wt-auth-list a {
    display: block;
    padding: 9px 14px;
    color: var(--wt-accent-dark);
}

.wt-auth-list a:hover {
    background: var(--wt-accent-soft);
    text-decoration: none;
}

.wt-auth a.wt-auth-submit {
    line-height: 44px;
    padding: 0;
    color: #fff;
}
