/**
 * LPF'26 — mise en page auth 2 colonnes (classique sombre + classique clair).
 * Couleurs : lpf-auth-dark.css (html.dark) et lpf-classic-light.css (html.lpf-classic-light).
 */

html.dark .auth-wrap,
html.lpf-classic-light .auth-wrap {
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

html.dark .auth-grid,
html.dark .ta-auth-grid,
html.lpf-classic-light .auth-grid,
html.lpf-classic-light .ta-auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(100vh, auto);
    min-height: 100vh;
    width: 100%;
    margin: 0;
    gap: 0;
    align-items: stretch;
}

html.dark .auth-aside,
html.dark .ta-auth-aside,
html.lpf-classic-light .auth-aside,
html.lpf-classic-light .ta-auth-aside {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    min-height: 100vh;
}

html.dark .ta-auth-brand-block,
html.lpf-classic-light .ta-auth-brand-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    width: 100%;
    max-width: min(36rem, 100%);
    margin: 0 auto;
}

html.dark .lpf-brand-logo-wrap .lpf-brand-logo--classic-dark,
html.lpf-classic-light .lpf-brand-logo-wrap .lpf-brand-logo--classic-light,
html.lpf-classic-light .lpf-brand-logo-wrap picture.lpf-brand-logo--classic-light {
    width: min(480px, 88vw);
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

html.lpf-classic-light .lpf-brand-logo-wrap picture.lpf-brand-logo--classic-light img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

html.dark .ta-auth-form-wrap,
html.lpf-classic-light .ta-auth-form-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem clamp(1.5rem, 5vw, 3.5rem);
    min-height: 100vh;
}

html.dark .ta-auth-title,
html.dark .section-title,
html.lpf-classic-light .ta-auth-title,
html.lpf-classic-light .section-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.75rem, 4vw, 2rem);
    font-weight: 700;
}

html.dark .ta-auth-lead,
html.lpf-classic-light .ta-auth-lead {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

html.dark .ta-auth-form,
html.lpf-classic-light .ta-auth-form {
    display: grid;
    gap: 0.4rem;
    width: 100%;
    max-width: 28rem;
}

html.dark .ta-auth-form-row-2,
html.lpf-classic-light .ta-auth-form-row-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

@media (min-width: 640px) {
    html.dark .ta-auth-form-row-2,
    html.lpf-classic-light .ta-auth-form-row-2 {
        grid-template-columns: 1fr 1fr;
        column-gap: 1rem;
    }
}

html.dark .ta-auth-form-wrap form label,
html.dark .ta-auth-form-wrap .ta-form-label,
html.dark .ta-auth-check label,
html.lpf-classic-light .ta-auth-form-wrap form label,
html.lpf-classic-light .ta-auth-form-wrap .ta-form-label,
html.lpf-classic-light .ta-auth-check label {
    display: block;
    margin-top: 0.65rem;
    font-size: 0.875rem;
    font-weight: 500;
}

html.dark .ta-auth-form-wrap form input[type="text"],
html.dark .ta-auth-form-wrap form input[type="email"],
html.dark .ta-auth-form-wrap form input[type="password"],
html.dark .ta-auth-form-wrap .ta-form-input,
html.dark .ta-auth-form-wrap .ta-form-select,
html.dark .ta-auth-form-wrap .ta-form-textarea,
html.lpf-classic-light .ta-auth-form-wrap form input[type="text"],
html.lpf-classic-light .ta-auth-form-wrap form input[type="email"],
html.lpf-classic-light .ta-auth-form-wrap form input[type="password"],
html.lpf-classic-light .ta-auth-form-wrap .ta-form-input,
html.lpf-classic-light .ta-auth-form-wrap .ta-form-select,
html.lpf-classic-light .ta-auth-form-wrap .ta-form-textarea {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.25rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.95rem;
    font-family: inherit;
    border-radius: 0.5rem;
}

/* Mot de passe connexion : afficher / masquer */
html.dark .ta-auth-password-wrap,
html.lpf-classic-light .ta-auth-password-wrap {
    position: relative;
    display: block;
    margin-top: 0.25rem;
}

html.dark .ta-auth-password-wrap > input,
html.lpf-classic-light .ta-auth-password-wrap > input {
    margin-top: 0;
    padding-right: 2.75rem;
}

html.dark .ta-auth-password-toggle,
html.lpf-classic-light .ta-auth-password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0.35rem;
    background: transparent;
    color: inherit;
    cursor: pointer;
    opacity: 0.65;
}

html.dark .ta-auth-password-toggle:hover,
html.lpf-classic-light .ta-auth-password-toggle:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}

html.dark .ta-auth-password-toggle:focus-visible,
html.lpf-classic-light .ta-auth-password-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

html.dark .ta-auth-password-toggle .ti,
html.lpf-classic-light .ta-auth-password-toggle .ti {
    font-size: 1.15rem;
    line-height: 1;
    pointer-events: none;
}

html.dark .ta-auth-check,
html.lpf-classic-light .ta-auth-check {
    margin: 0.75rem 0 0.25rem;
    font-size: 0.875rem;
}

html.dark body.front-body--auth .auth-wrap .ta-auth-submit,
html.dark body.front-body--auth .auth-wrap button[type="submit"],
html.lpf-classic-light body.front-body--auth .auth-wrap .ta-auth-submit,
html.lpf-classic-light body.front-body--auth .auth-wrap button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: auto;
    max-width: 100%;
    margin-top: 1rem;
    padding: 0.7rem 1.5rem;
    justify-self: start;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    border: 2px solid transparent;
    border-radius: 0;
    cursor: pointer;
    box-sizing: border-box;
    text-decoration: none;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

html.dark body.front-body--auth .auth-wrap .ta-auth-submit,
html.dark body.front-body--auth .auth-wrap button[type="submit"] {
    color: #fff;
    background-color: var(--auth-primary, #22c55e);
    border-color: var(--auth-primary, #22c55e);
}

html.dark body.front-body--auth .auth-wrap .ta-auth-submit:hover:not(:disabled),
html.dark
    body.front-body--auth
    .auth-wrap
    button[type="submit"]:hover:not(:disabled) {
    background-color: var(--auth-primary-hover, #16a34a);
    border-color: var(--auth-primary-hover, #16a34a);
}

html.lpf-classic-light body.front-body--auth .auth-wrap .ta-auth-submit,
html.lpf-classic-light body.front-body--auth .auth-wrap button[type="submit"] {
    color: #fff;
    background-color: var(--lpf-primary, #16a34a);
    border-color: var(--lpf-primary, #16a34a);
}

html.lpf-classic-light
    body.front-body--auth
    .auth-wrap
    .ta-auth-submit:hover:not(:disabled),
html.lpf-classic-light
    body.front-body--auth
    .auth-wrap
    button[type="submit"]:hover:not(:disabled) {
    background-color: var(--lpf-primary-hover, #15803d);
    border-color: var(--lpf-primary-hover, #15803d);
}

html.dark
    body.front-body--auth
    .auth-wrap
    .ta-auth-submit:active:not(:disabled),
html.dark
    body.front-body--auth
    .auth-wrap
    button[type="submit"]:active:not(:disabled),
html.lpf-classic-light
    body.front-body--auth
    .auth-wrap
    .ta-auth-submit:active:not(:disabled),
html.lpf-classic-light
    body.front-body--auth
    .auth-wrap
    button[type="submit"]:active:not(:disabled) {
    transform: scale(0.97);
}

html.dark body.front-body--auth .auth-wrap .ta-auth-submit:disabled,
html.dark body.front-body--auth .auth-wrap button[type="submit"]:disabled,
html.lpf-classic-light
    body.front-body--auth
    .auth-wrap
    .ta-auth-submit:disabled,
html.lpf-classic-light
    body.front-body--auth
    .auth-wrap
    button[type="submit"]:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

html.dark body.front-body--auth .auth-wrap .ta-auth-submit .ti,
html.lpf-classic-light body.front-body--auth .auth-wrap .ta-auth-submit .ti {
    font-size: 1.05rem;
    line-height: 1;
    flex-shrink: 0;
}

html.dark .ta-auth-link-row,
html.lpf-classic-light .ta-auth-link-row {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
}

html.dark .ta-auth-separator,
html.lpf-classic-light .ta-auth-separator {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 1rem 0;
    font-size: 0.8rem;
}

html.dark .ta-auth-separator::before,
html.dark .ta-auth-separator::after,
html.lpf-classic-light .ta-auth-separator::before,
html.lpf-classic-light .ta-auth-separator::after {
    content: "";
    flex: 1;
    height: 1px;
}

html.dark .auth-wrap > .flash,
html.lpf-classic-light .auth-wrap > .flash {
    max-width: 28rem;
    margin: 1rem auto 0;
    padding: 0.75rem 1rem;
    padding-left: clamp(1.5rem, 5vw, 3.5rem);
    padding-right: clamp(1.5rem, 5vw, 3.5rem);
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

html.dark .auth-wrap .ta-auth-form-wrap .flash,
html.lpf-classic-light .auth-wrap .ta-auth-form-wrap .flash {
    max-width: none;
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
}

html.dark .ta-form-choice-expanded,
html.lpf-classic-light .ta-form-choice-expanded {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

@media (max-width: 900px) {
    html.dark .auth-grid,
    html.dark .ta-auth-grid,
    html.lpf-classic-light .auth-grid,
    html.lpf-classic-light .ta-auth-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        min-height: auto;
    }

    html.dark .auth-aside,
    html.dark .ta-auth-aside,
    html.lpf-classic-light .auth-aside,
    html.lpf-classic-light .ta-auth-aside {
        min-height: clamp(220px, 38vh, 340px);
        border-right: none;
        border-bottom: 1px solid var(--auth-border, var(--lpf-border, #e2e8f0));
        padding: 0;
    }

    html.dark .lpf-brand-logo-wrap .lpf-brand-logo--classic-dark,
    html.lpf-classic-light .lpf-brand-logo-wrap .lpf-brand-logo--classic-light,
    html.lpf-classic-light .lpf-brand-logo-wrap picture.lpf-brand-logo--classic-light {
        width: min(360px, 94vw);
    }

    html.dark .ta-auth-form-wrap,
    html.lpf-classic-light .ta-auth-form-wrap {
        min-height: auto;
        padding: 2rem 1.25rem 2.5rem;
    }

    html.dark body.front-body--auth .ta-auth-form,
    html.lpf-classic-light body.front-body--auth .ta-auth-form {
        max-width: none;
    }
}
