/*
 * Habille les pages communes du compte (app/Views/pages/auth) aux couleurs
 * Yrytys, sans vue propre a la marque : chargee par brand_stylesheet('auth.css')
 * apres les styles de chaque page. Anneaux de 1 px, aucune ombre portee.
 */

html:root {
    --dash-bg: var(--yr-papier);
    --dash-surface: var(--yr-blanc);
    --dash-text: var(--yr-encre-900);
    --dash-muted: var(--yr-encre-500);
    --dash-border: var(--yr-ligne);
    --dash-primary: var(--yr-sceau-600);
    --dash-primary-dark: var(--yr-sceau-700);
    --dash-primary-light: var(--yr-sceau-clair);
    --dash-primary-tint: var(--yr-valide-bg);
    --dash-primary-tint-soft: var(--yr-valide-bg);
    --dash-primary-wash: var(--yr-papier);
    --dash-ring: rgba(79, 179, 161, .35);
    --dash-ring-strong: rgba(79, 179, 161, .45);
    --dash-shadow-xs: transparent;
    --dash-shadow-sm: transparent;
    --dash-shadow-md: transparent;
    --dash-shadow-lg: transparent;
    --dash-input-locked-bg: var(--yr-papier);
    --dash-input-locked-border: var(--yr-encre-200);
    --dash-success-text: var(--yr-sceau-600);
    --dash-success-ink: var(--yr-sceau-700);
    --dash-success-bg: var(--yr-valide-bg);
    --dash-success-border: var(--yr-sceau-clair);
    --dash-error: var(--yr-refuse-text);
    --dash-error-dark: var(--yr-refuse-text);
    --dash-error-bg: var(--yr-refuse-bg);
    --dash-error-border: var(--yr-refuse-bg);
}

body {
    font-family: var(--yr-font);
    -webkit-font-smoothing: antialiased;
}

/* Barre haute */
.auth-topbar-action {
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px var(--yr-sceau-600);
    display: inline-flex;
    align-items: center;
    font-size: var(--yr-text-small);
    color: var(--yr-sceau-600);
}

.auth-topbar-action:hover {
    box-shadow: inset 0 0 0 2px var(--yr-sceau-600);
}

.auth-home-logo {
    height: 30px;
}

/* Cartes */
.login-card,
.register-card {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 0 0 1px var(--yr-ligne);
    padding: 36px 32px;
}

.login-title,
.register-title {
    font-weight: 800;
    font-size: var(--yr-text-title-lg);
    line-height: 1.15;
    letter-spacing: -.03em;
    color: var(--yr-encre-900);
    text-align: left;
}

.login-subtitle,
.register-intro {
    color: var(--yr-encre-700);
    text-align: left;
}

.register-steps {
    justify-content: flex-start;
    font-family: var(--yr-mono);
    font-size: var(--yr-text-micro);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.register-steps-dot {
    font-family: var(--yr-font);
    font-size: var(--yr-text-micro);
    font-weight: 600;
    letter-spacing: 0;
    color: var(--yr-encre-700);
}

.register-steps-dot--current {
    color: var(--yr-blanc);
}

/* Champs */
.login-label,
.register-label {
    font-size: var(--yr-text-small);
    color: var(--yr-encre-900);
}

.login-input,
.register-input {
    border-color: var(--yr-encre-200);
    border-radius: 8px;
    font-family: var(--yr-font);
    color: var(--yr-encre-900);
    background: var(--yr-blanc);
}

.login-input::placeholder,
.register-input::placeholder {
    color: var(--yr-encre-300);
}

.login-input:focus,
.register-input:focus {
    border-color: var(--yr-sceau-600);
    box-shadow: 0 0 0 3px var(--dash-ring);
}

.login-input--error,
.register-input--error {
    border-color: var(--yr-refuse-text);
}

#siret,
#tva,
#code_postal {
    font-family: var(--yr-mono);
    letter-spacing: .04em;
}

select.register-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230E1A24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.login-toggle:focus-visible,
.register-toggle:focus-visible {
    outline-color: var(--yr-sceau-clair);
}

/* Choix particulier / societe */
.register-type {
    border-color: var(--yr-ligne);
    border-radius: 10px;
}

.register-type:hover {
    border-color: var(--yr-sceau-600);
}

.register-type--selected {
    border-color: var(--yr-sceau-600);
    box-shadow: inset 0 0 0 1px var(--yr-sceau-600);
}

.register-type-title {
    color: var(--yr-encre-900);
}

.register-identity {
    border-radius: 8px;
    background: var(--yr-papier);
    border-color: var(--yr-papier);
}

.register-identity span {
    font-family: var(--yr-mono);
    font-size: var(--yr-text-small);
}

.register-type input,
.register-check input {
    accent-color: var(--yr-sceau-600);
}

/* Regles du mot de passe */
.register-rules-item--valid::before {
    background: var(--yr-sceau-600);
}

/* Boutons et liens */
.login-btn,
.register-btn {
    height: 48px;
    padding: 0 20px;
    border-radius: 8px;
    font-size: var(--yr-text-body);
    font-weight: 600;
    background: var(--yr-sceau-600);
    transition: background-color var(--yr-dur-1, 120ms) ease;
}

.login-btn:hover,
.register-btn:hover {
    background: var(--yr-sceau-700);
}

.login-btn:focus-visible,
.register-btn:focus-visible {
    outline: 3px solid var(--dash-ring-strong);
    outline-offset: 2px;
}

.login-footer a,
.login-forgot a,
.register-footer a,
.register-identity a,
.register-check a,
.register-legal a {
    color: var(--yr-sceau-600);
    text-decoration: underline;
    text-decoration-color: rgba(15, 107, 93, .35);
    text-underline-offset: 3px;
}

.login-footer a:hover,
.login-forgot a:hover,
.register-footer a:hover,
.register-identity a:hover,
.register-check a:hover,
.register-legal a:hover {
    text-decoration-color: currentColor;
}

/* Messages */
.login-error,
.login-success,
.register-error {
    border: 0;
    border-radius: 8px;
}

.login-error,
.register-error {
    background: var(--yr-refuse-bg);
    color: var(--yr-refuse-text);
}

.login-success {
    background: var(--yr-valide-bg);
    color: var(--yr-sceau-700);
}

/* Pied de page */
.auth-footer-help-title {
    color: var(--yr-encre-900);
}

.auth-footer-contact {
    border: 0;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px var(--yr-ligne);
    color: var(--yr-encre-900);
    font-family: var(--yr-mono);
    font-size: var(--yr-text-caption);
    transition: box-shadow var(--yr-dur-1, 120ms) ease;
}

.auth-footer-contact:hover {
    box-shadow: inset 0 0 0 1px var(--yr-sceau-600);
}

/* Les icones communes sont bleues : passees en encre par filtre. */
.auth-footer-contact img {
    filter: grayscale(1) brightness(.2);
}

/* Panneau de marque (partials/auth/_brand-panel.php, planches « Compte - variante B ») */
.auth--split {
    --auth-panel-bg: var(--yr-encre-900);
    --auth-panel-text: var(--yr-encre-200);
    --auth-panel-title: var(--yr-blanc);
    --auth-panel-accent: var(--yr-ambre);
    --auth-panel-surface: var(--yr-blanc);
}

.auth-panel-phone {
    font-family: var(--yr-mono);
    font-weight: 500;
}

.auth--split .login-title,
.auth--split .register-title {
    font-size: 30px;
}

/* Cibles tactiles de 44 px sur les pages du compte, sans changer le rendu */
@media (pointer: coarse) {
    .login-toggle {
        right: .25rem;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }

    .login-forgot a,
    .login-footer a,
    .auth-panel-phone {
        display: inline-block;
        padding-block: 14px;
        margin-block: -14px;
    }

    .auth-panel-home {
        padding-block: 10px;
        margin-block: -10px;
    }
}

/* Lisibilite des pages du compte : interligne et retours a la ligne */
:is(.login-title, .register-title) {
    text-wrap: balance;
}

:is(.login-subtitle, .register-intro, .register-footer, .register-legal, .login-footer) {
    line-height: 1.5;
    text-wrap: pretty;
}
