/* ════════════════════════════════
   AUTH (login / register / forgot / reset) - style Aperitiu
   Hero orange + carte polaroid + form inputs branded.
   Préserve les class names que les JS utilisent : .login-card, .register-card,
   .pwd-toggle, .pwd-rule, .register-strength-bar, etc.
════════════════════════════════ */

.au-page {
    --au-cream:     #f3e9d7;
    --au-cream-2:   #fbf4e9;
    --au-cream-3:   #f1ead8;
    --au-white-2:   #fffdf8;
    --au-orange:    #ffa200;
    --au-orange-2:  #f3a63c;
    --au-red:       #e85a28;
    --au-dark:      #242323;
    --au-grey:      #dbdbdb;
    --au-error:     #c0392b;
    --au-success:   #2e9e7a;

    --au-font-display: 'Erica One', 'Anton', Impact, sans-serif;
    --au-font-script:  'Darumadrop One', 'Caveat', cursive;
    --au-font-body:    'DM Sans', sans-serif;
    --au-font-ui:      'Poppins', system-ui, sans-serif;

    --au-max:   1440px;
    --au-pad:   100px;

    background: var(--au-cream);
    overflow-x: clip;
}

.au-page main { padding-top: 0; }
body.au-page > .blob { display: none !important; }
.au-page h1, .au-page h2, .au-page h3 { margin: 0; }
.au-page img { display: block; max-width: 100%; }

/* ════════════════════════════════
   1. HERO compact (pour pages auth)
════════════════════════════════ */
.au-hero {
    position: relative;
    min-height: 460px;
    background-color: var(--au-red);
    background-image: url('/images/home/union3.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    isolation: isolate;
    overflow: visible;
}

.au-hero-mascot {
    position: absolute;
    top: 124px;
    left: calc(50% - 720px + 14px);
    width: 100px;
    height: 88px;
    z-index: 5;
    pointer-events: none;
    transform: scaleY(-1) rotate(174.51deg);
}
.au-hero-mascot img { width: 100%; height: 100%; object-fit: contain; }

.au-hero-inner {
    position: relative;
    z-index: 2;
    max-width: var(--au-max);
    margin: 0 auto;
    padding: 200px var(--au-pad) 80px;
    box-sizing: border-box;
    color: #fff;
    text-align: center;
}

.au-hero-title {
    font-family: var(--au-font-display);
    font-size: clamp(60px, 6.5vw, 100px);
    font-weight: 400;
    color: #fff;
    text-transform: uppercase;
    line-height: 1.05;
    letter-spacing: -1.5px;
    margin: 0;
}

.au-hero-desc {
    margin: 22px auto 0;
    font-family: var(--au-font-body);
    font-size: 18px;
    line-height: 1.55;
    color: #fff;
    max-width: 580px;
}

.au-hero-dots {
    position: absolute;
    bottom: -17px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--au-max);
    padding: 0 var(--au-pad);
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    z-index: 3;
    pointer-events: none;
}

.au-hero-dots span {
    width: 34px;
    height: 34px;
    background: var(--au-orange-2);
    flex: 0 0 34px;
}

/* ════════════════════════════════
   2. SECTION CARD
════════════════════════════════ */
.au-section {
    padding: 80px var(--au-pad) 120px;
    background: var(--au-cream);
}

/* Carte polaroid - on cible .login-card et .register-card pour ne pas casser le markup */
.au-page .login-card,
.au-page .register-card {
    max-width: 560px;
    margin: 0 auto;
    background: var(--au-white-2);
    border: 18px solid #fff;
    box-sizing: border-box;
    padding: 44px 40px 36px;
    box-shadow:
        2px 9px 21px rgba(0, 0, 0, .1),
        7px 38px 39px rgba(0, 0, 0, .08),
        16px 85px 52px rgba(0, 0, 0, .04);
    position: relative;
    animation: au-card-in .5s ease both;
}

.au-page .register-card {
    max-width: 640px;
}

@keyframes au-card-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Le logo intégré du partial _auth_logo.html.twig - on le minimise dans la carte
   puisque le hero affiche déjà le titre principal. */
.au-page .login-card > a:first-child,
.au-page .register-card > a:first-child {
    display: block;
    text-align: center;
    margin: 0 auto 18px;
    width: 64px;
}

.au-page .login-card > a:first-child img,
.au-page .register-card > a:first-child img {
    max-width: 100%;
    height: auto;
}

/* Titre principal dans la carte (ex: "Bon retour.") */
.au-page .login-card h1,
.au-page .register-card h1 {
    font-family: var(--au-font-script);
    font-size: 36px;
    color: var(--au-dark);
    text-align: center;
    line-height: 1.1;
    margin-bottom: 6px;
}

.au-page .login-subtitle,
.au-page .register-subtitle {
    font-family: var(--au-font-body);
    font-size: 15px;
    color: rgba(36, 35, 35, .65);
    text-align: center;
    margin: 0 0 26px;
}

/* ════════════════════════════════
   3. INPUTS / CHAMPS (login + register + forgot + reset)
════════════════════════════════ */
.au-page .login-field,
.au-page .register-field {
    margin-bottom: 18px;
}

.au-page .register-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.au-page .register-row-2 .register-field { margin-bottom: 0; }

.au-page .login-field label,
.au-page .register-field label {
    font-family: var(--au-font-script);
    font-size: 18px;
    color: var(--au-dark);
    margin-bottom: 6px;
    display: block;
}

.au-page .required {
    color: var(--au-red);
    font-weight: 400;
}

/* Wrap input + icône à gauche */
.au-page .login-input-wrap,
.au-page .register-input-wrap {
    position: relative;
}

.au-page .login-input-wrap input,
.au-page .register-input-wrap input,
.au-page .login-field input,
.au-page .register-field input {
    width: 100%;
    background: var(--au-cream-2);
    border: 1.5px solid transparent;
    border-radius: 14px;
    padding: 13px 18px 13px 46px;
    font-family: var(--au-font-body);
    font-size: 16px;
    color: var(--au-dark);
    outline: none;
    box-sizing: border-box;
    transition: background .15s, border-color .15s, box-shadow .15s;
}

.au-page .login-input-wrap input::placeholder,
.au-page .register-input-wrap input::placeholder {
    color: rgba(36, 35, 35, .4);
}

.au-page .login-input-wrap input:hover,
.au-page .register-input-wrap input:hover {
    background: #fff;
}

.au-page .login-input-wrap input:focus,
.au-page .register-input-wrap input:focus {
    background: #fff;
    border-color: var(--au-orange-2);
    box-shadow: 0 0 0 4px rgba(243, 166, 60, .15);
}

/* Icône à gauche dans le wrap */
.au-page .login-input-wrap > svg:first-of-type,
.au-page .register-input-wrap > svg:first-of-type {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: none;
    stroke: rgba(36, 35, 35, .55);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

/* Bouton "oeil" pour password */
.au-page .pwd-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 6px;
    color: rgba(36, 35, 35, .55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.au-page .pwd-toggle:hover { color: var(--au-red); }

.au-page .pwd-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.au-page .pwd-toggle .eye-off { display: none; }
.au-page .pwd-toggle.show .eye-on { display: none; }
.au-page .pwd-toggle.show .eye-off { display: block; }

/* Errors de champ */
.au-page [data-error]:not(:empty) {
    color: var(--au-error);
    font-family: var(--au-font-body);
    font-size: 13px;
    line-height: 1.4;
    margin-top: 6px;
}

.au-page [data-error] ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Login row (remember + forgot) */
.au-page .login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 22px;
    flex-wrap: wrap;
}

.au-page .login-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--au-font-body);
    font-size: 14px;
    color: var(--au-dark);
    cursor: pointer;
}

.au-page .login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--au-red);
}

.au-page .login-forgot {
    font-family: var(--au-font-body);
    font-size: 14px;
    color: var(--au-red);
    text-decoration: none;
    transition: opacity .15s;
}

.au-page .login-forgot:hover { opacity: .75; text-decoration: underline; }

/* ════════════════════════════════
   4. BOUTONS PRINCIPAUX
════════════════════════════════ */
.au-page .login-btn,
.au-page .register-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: var(--au-orange-2);
    color: #fff;
    border: 0;
    text-decoration: none;
    padding: 16px 32px;
    border-radius: 80px;
    font-family: var(--au-font-body);
    font-weight: 600;
    font-size: 17px;
    line-height: 1.4;
    cursor: pointer;
    transition: background .15s, transform .15s, box-shadow .15s;
    box-sizing: border-box;
}

.au-page .login-btn:hover,
.au-page .register-btn:hover {
    background: var(--au-red);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(232, 90, 40, .25);
}

.au-page .login-btn:disabled,
.au-page .register-btn:disabled {
    background: var(--au-grey);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Bouton "social" Google */
.au-page .login-btn-social,
.au-page .register-btn-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: #fff;
    color: var(--au-dark);
    border: 1.5px solid var(--au-grey);
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 80px;
    font-family: var(--au-font-body);
    font-weight: 600;
    font-size: 16px;
    margin-top: 12px;
    transition: border-color .15s, background .15s, transform .15s;
    box-sizing: border-box;
}

.au-page .login-btn-social:hover,
.au-page .register-btn-social:hover {
    background: var(--au-cream-2);
    border-color: var(--au-orange-2);
    transform: translateY(-1px);
}

/* Divider "ou continuer avec" */
.au-page .login-divider,
.au-page .register-divider {
    margin: 22px 0 6px;
    text-align: center;
    font-family: var(--au-font-body);
    font-size: 13px;
    color: rgba(36, 35, 35, .5);
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
}

.au-page .login-divider::before,
.au-page .login-divider::after,
.au-page .register-divider::before,
.au-page .register-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--au-grey);
}

/* Footer link (Pas de compte / Déjà inscrit) */
.au-page .login-footer-link,
.au-page .register-footer-link {
    margin: 22px 0 0;
    text-align: center;
    font-family: var(--au-font-body);
    font-size: 14px;
    color: rgba(36, 35, 35, .7);
}

.au-page .login-footer-link a,
.au-page .register-footer-link a {
    color: var(--au-red);
    text-decoration: none;
    font-weight: 600;
}

.au-page .login-footer-link a:hover,
.au-page .register-footer-link a:hover {
    text-decoration: underline;
}

/* ════════════════════════════════
   5. REGISTER : steps + strength meter + cgu
════════════════════════════════ */
.au-page .register-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 28px;
    flex-wrap: wrap;
}

.au-page .register-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--au-font-body);
    font-size: 13px;
    color: rgba(36, 35, 35, .5);
    font-weight: 500;
}

.au-page .register-step.active {
    color: var(--au-dark);
}

.au-page .register-step-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--au-cream-2);
    color: rgba(36, 35, 35, .55);
    border: 1.5px solid var(--au-grey);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.au-page .register-step.active .register-step-dot {
    background: var(--au-orange-2);
    color: #fff;
    border-color: var(--au-orange-2);
}

.au-page .register-step-line {
    flex: 0 0 28px;
    height: 1.5px;
    background: var(--au-grey);
    border-radius: 1px;
}

/* Strength meter */
.au-page .register-strength {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin: 10px 0 6px;
}

.au-page .register-strength-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--au-cream-3);
    transition: background .15s;
}

.au-page .register-strength-bar.active-1 { background: #e74c3c; }
.au-page .register-strength-bar.active-2 { background: var(--au-orange-2); }
.au-page .register-strength-bar.active-3 { background: var(--au-orange); }
.au-page .register-strength-bar.active-4 { background: var(--au-success); }

.au-page .register-strength-label {
    font-family: var(--au-font-body);
    font-size: 12px;
    color: rgba(36, 35, 35, .65);
    margin: 0 0 10px;
    min-height: 1em;
}

/* Liste des règles password */
.au-page .pwd-rules {
    list-style: none;
    padding: 0;
    margin: 8px 0 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 14px;
}

.au-page .pwd-rule {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--au-font-body);
    font-size: 12.5px;
    color: rgba(36, 35, 35, .55);
    transition: color .15s;
}

.au-page .pwd-rule-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--au-cream-3);
    border: 1.5px solid var(--au-grey);
    position: relative;
    flex: 0 0 14px;
    transition: background .15s, border-color .15s;
}

.au-page .pwd-rule.valid {
    color: var(--au-success);
}

.au-page .pwd-rule.valid .pwd-rule-icon {
    background: var(--au-success);
    border-color: var(--au-success);
}

.au-page .pwd-rule.valid .pwd-rule-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/10px no-repeat;
}

.au-page .pwd-refused {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(231, 76, 60, .08);
    border: 1px solid rgba(231, 76, 60, .2);
    border-radius: 8px;
    font-family: var(--au-font-body);
    font-size: 12.5px;
    color: var(--au-error);
    display: flex;
    align-items: center;
    gap: 8px;
}

.au-page .pwd-refused svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    stroke: currentColor;
}

.au-page .pwd-refused code {
    background: rgba(231, 76, 60, .12);
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 12px;
    font-family: ui-monospace, monospace;
}

/* ── Checkboxes CGU / Âge (identité Aperitiu) ──
   Native checkbox masquée, on dessine notre propre case carrée avec coche
   SVG inline pour un rendu cohérent cross-browser et accessible (focus-visible). */
.au-page .register-cgu {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 14px 0 0;
    padding: 12px 14px;
    background: var(--au-cream-2);
    border: 1.5px solid rgba(36, 35, 35, 0.10);
    border-radius: 12px;
    font-family: var(--au-font-body);
    font-size: 13.5px;
    color: var(--au-dark);
    line-height: 1.55;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
    user-select: none;
}
.au-page .register-cgu:hover {
    background: #fff;
    border-color: rgba(232, 90, 40, 0.35);
}
.au-page .register-cgu:has(input[type="checkbox"]:checked) {
    border-color: rgba(232, 90, 40, 0.5);
    background: rgba(255, 162, 0, 0.08);
}

/* Native checkbox masquée, accessible via focus */
.au-page .register-cgu input[type="checkbox"] {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    margin: 0; padding: 0;
    border: 0;
    white-space: nowrap;
}

/* Case dessinée via ::before sur le <span> qui suit le checkbox */
.au-page .register-cgu input[type="checkbox"] + span {
    position: relative;
    padding-left: 32px;
    flex: 1;
    min-height: 22px;
    display: block;
}
.au-page .register-cgu input[type="checkbox"] + span::before {
    content: '';
    position: absolute;
    left: 0; top: 1px;
    width: 22px; height: 22px;
    border-radius: 7px;
    background: #fff;
    border: 1.5px solid rgba(36, 35, 35, 0.25);
    box-shadow: 0 1px 2px rgba(36, 35, 35, 0.06);
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
    box-sizing: border-box;
}
.au-page .register-cgu input[type="checkbox"] + span::after {
    content: '';
    position: absolute;
    left: 5px; top: 7px;
    width: 12px; height: 10px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 9 7 13 13 4'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    transform: scale(.6) rotate(-8deg);
    transition: opacity .18s ease, transform .22s cubic-bezier(.22,.68,0,1.6);
}

.au-page .register-cgu:hover input[type="checkbox"] + span::before {
    border-color: rgba(232, 90, 40, 0.6);
}

.au-page .register-cgu input[type="checkbox"]:checked + span::before {
    background: var(--au-red);
    border-color: var(--au-red);
    box-shadow: 0 4px 10px rgba(232, 90, 40, 0.28);
}
.au-page .register-cgu input[type="checkbox"]:checked + span::after {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.au-page .register-cgu input[type="checkbox"]:focus-visible + span::before {
    outline: 3px solid rgba(232, 90, 40, 0.35);
    outline-offset: 2px;
}

.au-page .register-cgu a {
    color: var(--au-red);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}

.au-page .register-cgu a:hover { color: #b22222; }

.au-page .register-cgu strong { color: var(--au-red); font-weight: 600; }

.au-page .register-errors {
    background: rgba(231, 76, 60, .08);
    border: 1px solid rgba(231, 76, 60, .25);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-family: var(--au-font-body);
    font-size: 13.5px;
    color: var(--au-error);
}

.au-page .register-errors ul { list-style: none; padding: 0; margin: 0; }

/* Pour le register-btn qui doit avoir un margin-top spécifique */
.au-page .register-btn {
    margin-top: 22px;
}

/* État erreur login */
.au-page .login-error {
    padding: 14px 16px;
    background: rgba(231, 76, 60, .08);
    border: 1px solid rgba(231, 76, 60, .25);
    border-radius: 8px;
    font-family: var(--au-font-body);
    font-size: 14px;
    color: var(--au-error);
    line-height: 1.5;
}

/* ════════════════════════════════
   6. RESPONSIVE
════════════════════════════════ */
@media (max-width: 1440px) {
    .au-page { --au-pad: 60px; }
    .au-hero-mascot { left: 30px; }
}

@media (max-width: 640px) {
    .au-page .login-card,
    .au-page .register-card { padding: 32px 24px 28px; }
    .au-page .register-row-2 { grid-template-columns: 1fr; }
    .au-page .pwd-rules { grid-template-columns: 1fr; }
    .au-page .au-hero-inner { padding: 160px var(--au-pad) 60px; }
    .au-page .au-hero-title { font-size: 52px; }
}
