/* ============================================================
   Page d'authentification unifiee oPaddock
   Layout split premium : visuel cheval gauche + carte droite
   Prefix : .auth-*    Variables : voir style_header.css
   ============================================================ */

/* La page d'auth occupe tout l'ecran : pas de padding-top header */
body.opd-auth-page {
    margin: 0;
    padding-top: 0 !important;
    background: #fff;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--slate-800);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
body.opd-auth-page .opd-footer { display: none; }

.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

/* ========================================
   COLONNE GAUCHE : VISUEL PREMIUM
   ======================================== */
.auth-visual {
    position: relative;
    overflow: hidden;
    color: #fff;
    isolation: isolate;
}
.auth-visual-image {
    position: absolute; inset: 0;
    background-image: url('https://images.unsplash.com/photo-1553284965-83fd3e82fa5a?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=85');
    background-size: cover;
    background-position: center;
    filter: brightness(.78) saturate(1.05);
    animation: authVisualZoom 22s ease-in-out infinite alternate;
    z-index: 1;
}
@keyframes authVisualZoom {
    0%   { transform: scale(1); }
    100% { transform: scale(1.08); }
}
.auth-visual-overlay {
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(var(--primary-rgb), .55), transparent 60%),
        linear-gradient(135deg, rgba(6, 78, 59, .55) 0%, rgba(15, 23, 42, .55) 100%);
    z-index: 2;
}
.auth-visual-content {
    position: relative;
    z-index: 3;
    height: 100%;
    padding: 56px 64px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 28px;
}
.auth-visual-back {
    position: absolute;
    top: 32px; left: 32px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .18);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all .25s ease;
}
.auth-visual-back:hover {
    background: rgba(255, 255, 255, .22);
    transform: translateX(-3px);
}
.auth-visual-back i { font-size: 16px; }

.auth-visual-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
/* Marque du logo (cheval blanc transparent) incrustee dans le badge degrade. */
.auth-visual-logo-mark picture { display: flex; }
.auth-visual-logo-mark img { display: block; width: 35px; height: 31px; object-fit: contain; }
.auth-visual-logo-mark {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    border-radius: 14px;
    display: grid; place-items: center;
    color: #fff;
    font-size: 22px;
    box-shadow: 0 14px 32px rgba(var(--primary-rgb), .45);
}
.auth-visual-logo-text {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.auth-visual-title {
    font-size: clamp(38px, 4vw, 56px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.03em;
    margin: 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, .3);
}
.auth-visual-quote {
    font-size: 17px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .92);
    max-width: 460px;
    margin: 0;
    font-style: italic;
}
.auth-visual-stats {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 36px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .18);
}
.auth-visual-stats > div { display: flex; flex-direction: column; }
.auth-visual-stats strong {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: #fff;
}
.auth-visual-stats span {
    font-size: 12px;
    color: rgba(255, 255, 255, .8);
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* ========================================
   COLONNE DROITE : FORMULAIRE
   ======================================== */
.auth-panel {
    position: relative;
    padding: 56px clamp(32px, 6vw, 80px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(circle at 100% 0%, rgba(var(--primary-rgb), .07), transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(59, 130, 246, .05), transparent 50%),
        #fff;
}
.auth-panel-logo {
    display: none;          /* affiche uniquement quand le visuel est masque (mobile) */
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 32px;
}
.auth-panel-logo-mark picture { display: flex; }
.auth-panel-logo-mark img { display: block; width: 29px; height: 26px; object-fit: contain; }
.auth-panel-logo-mark {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    border-radius: 12px;
    display: grid; place-items: center;
    color: #fff;
    font-size: 19px;
    box-shadow: 0 10px 24px rgba(var(--primary-rgb), .35);
}
.auth-panel-logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
    background: linear-gradient(135deg, var(--primary-dark), var(--blue-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* Progress bar */
.auth-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 36px;
}
.auth-progress-step {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--slate-100);
    color: var(--slate-400);
    font-size: 16px;
    border: 2px solid transparent;
    transition: all .35s var(--ease-spring);
}
.auth-progress-step.is-active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 6px 18px rgba(var(--primary-rgb), .4);
    transform: scale(1.05);
}
.auth-progress-line {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    background: var(--slate-100);
    overflow: hidden;
    position: relative;
}
.auth-progress-line::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .55s var(--ease-out);
}
.auth-progress[data-progress="2"] .auth-progress-line::after { transform: scaleX(1); }

/* Steps : on les empile et anime via opacity/translate */
.auth-step {
    display: none;
    flex-direction: column;
    gap: 18px;
    animation: authStepIn .45s var(--ease-out) backwards;
}
.auth-step.is-current { display: flex; }
@keyframes authStepIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* En-tete */
.auth-head { position: relative; margin-bottom: 6px; }
.auth-back {
    position: absolute;
    top: 2px; left: -8px;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--slate-500);
    cursor: pointer;
    transition: all .2s ease;
}
.auth-back:hover {
    background: var(--slate-100);
    color: var(--primary-dark);
    transform: translateX(-2px);
}
.auth-back + .auth-title { padding-left: 36px; }
.auth-back + .auth-title + .auth-subtitle { padding-left: 36px; }

.auth-title {
    font-size: clamp(26px, 2.6vw, 32px);
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -.025em;
    line-height: 1.15;
    margin: 0 0 8px;
}
.auth-subtitle {
    font-size: 15px;
    color: var(--slate-500);
    line-height: 1.55;
    margin: 0;
}
.auth-subtitle strong {
    color: var(--primary-dark);
    font-weight: 600;
    word-break: break-all;
}

/* Champs */
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-700);
    letter-spacing: -.005em;
}
.auth-optional {
    color: var(--slate-400);
    font-weight: 500;
}
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.auth-input {
    width: 100%;
    height: 52px;
    padding: 0 14px 0 46px;
    border: 1.5px solid var(--slate-200);
    border-radius: 14px;
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    color: var(--slate-800);
    transition: all .2s ease;
}
.auth-input::placeholder { color: var(--slate-400); }
.auth-input:hover { border-color: var(--slate-300); }
.auth-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .12);
}
.auth-input-icon {
    position: absolute;
    left: 16px;
    color: var(--slate-400);
    font-size: 18px;
    pointer-events: none;
    transition: color .2s ease;
}
.auth-input:focus ~ .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon { color: var(--primary); }
.auth-input-toggle {
    position: absolute;
    right: 8px;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border: none;
    background: transparent;
    color: var(--slate-400);
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s ease;
}
.auth-input-toggle:hover { background: var(--slate-100); color: var(--slate-700); }
.auth-field-error {
    font-size: 12.5px;
    color: var(--red-500);
    margin: 0;
    min-height: 0;
    line-height: 1.4;
    transition: min-height .2s;
}
.auth-field-error:not(:empty) { min-height: 18px; }

/* Grille 2 colonnes (prenom/nom) */
.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Row utilitaire */
.auth-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -8px;
}
.auth-link {
    font-size: 13px;
    color: var(--primary-dark);
    font-weight: 500;
    text-decoration: none;
    transition: color .2s;
}
.auth-link:hover { color: var(--primary-darker); text-decoration: underline; }

/* Force de mot de passe */
.auth-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}
.auth-strength-bar {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: var(--slate-100);
    position: relative;
    overflow: hidden;
}
.auth-strength-bar::after {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: var(--strength, 0%);
    background: var(--strength-color, var(--red-500));
    border-radius: 4px;
    transition: width .3s ease, background .3s ease;
}
.auth-strength-label {
    font-size: 11.5px;
    color: var(--slate-500);
    font-weight: 600;
    letter-spacing: .02em;
    min-width: 60px;
    text-align: right;
}

/* Checkbox */
.auth-checkbox {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    font-size: 13px;
    color: var(--slate-600);
    line-height: 1.5;
    user-select: none;
}
.auth-checkbox input { display: none; }
.auth-checkbox-box {
    flex-shrink: 0;
    width: 20px; height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--slate-300);
    background: #fff;
    display: grid; place-items: center;
    color: transparent;
    font-size: 13px;
    transition: all .2s ease;
}
.auth-checkbox input:checked + .auth-checkbox-box {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), .3);
}
.auth-checkbox-text a { color: var(--primary-dark); font-weight: 500; }
.auth-checkbox-text a:hover { text-decoration: underline; }

/* Bouton principal */
.auth-btn-primary {
    position: relative;
    height: 54px;
    padding: 0 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(var(--primary-rgb), .35);
    transition: all .25s ease;
    overflow: hidden;
}
.auth-btn-primary::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, .18), transparent);
    transform: translateX(-100%);
    transition: transform .6s;
}
.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(var(--primary-rgb), .45);
}
.auth-btn-primary:hover::before { transform: translateX(100%); }
.auth-btn-primary:active { transform: translateY(0); }
.auth-btn-primary:disabled { opacity: .65; cursor: wait; transform: none; }
.auth-btn-icon { font-size: 18px; transition: transform .25s ease; }
.auth-btn-primary:hover .auth-btn-icon { transform: translateX(3px); }
.auth-btn-spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin .7s linear infinite;
}
.auth-btn-primary.is-loading .auth-btn-label,
.auth-btn-primary.is-loading .auth-btn-icon { display: none; }
.auth-btn-primary.is-loading .auth-btn-spinner { display: inline-block; }
@keyframes authSpin { to { transform: rotate(360deg); } }

/* Mention legale */
.auth-legal {
    font-size: 12px;
    color: var(--slate-500);
    text-align: center;
    line-height: 1.55;
    margin: 4px 0 0;
}
.auth-legal a { color: var(--primary-dark); font-weight: 500; }
.auth-legal a:hover { text-decoration: underline; }

/* Erreurs serveur */
.auth-errors {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}
.auth-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(239, 68, 68, .06);
    border: 1px solid rgba(239, 68, 68, .2);
    color: #b91c1c;
    font-size: 13.5px;
    line-height: 1.4;
}
.auth-error i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* Etat succes */
.auth-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 16px 0;
}
.auth-success-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), .15), rgba(var(--primary-rgb), .05));
    color: var(--primary-dark);
    display: grid; place-items: center;
    font-size: 32px;
    animation: authSuccessPop .5s var(--ease-spring) backwards;
}
@keyframes authSuccessPop {
    from { transform: scale(.4); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Étape de confirmation post-inscription */
.auth-success-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    background: rgba(var(--primary-rgb), .06);
    border: 1.5px solid rgba(var(--primary-rgb), .18);
    border-radius: 14px;
    padding: 14px 16px;
    text-align: left;
}
.auth-success-step-icon {
    font-size: 22px;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 1px;
}
.auth-success-step-body {
    font-size: 14px;
    color: var(--slate-700);
    line-height: 1.5;
}
.auth-success-step-body strong { color: var(--slate-900); }

.auth-success-divider {
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: .06em;
    position: relative;
}
.auth-success-divider::before,
.auth-success-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 28%;
    height: 1px;
    background: var(--slate-200);
}
.auth-success-divider::before { left: 0; }
.auth-success-divider::after  { right: 0; }

.auth-success-cases {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
.auth-success-case {
    background: var(--slate-50, #f8fafc);
    border: 1.5px solid var(--slate-200);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-success-case p {
    font-size: 13px;
    color: var(--slate-600);
    margin: 0;
    line-height: 1.5;
}
.auth-success-case p strong { color: var(--slate-800); }
.auth-success-case-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    width: fit-content;
}
.auth-success-case-badge.auto {
    background: rgba(var(--primary-rgb), .12);
    color: var(--primary-dark);
}
.auth-success-case-badge.pending {
    background: rgba(245, 158, 11, .12);
    color: #b45309;
}

/* ========================================
   AVATAR PICKER (inscription)
   ======================================== */
.auth-avatar-picker {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px;
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: 16px;
    margin-bottom: 20px;
    cursor: pointer;
}
.auth-avatar-picker:hover { border-color: var(--primary, #10b981); }

.auth-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: #e2e8f0;
}
.auth-avatar-preview img,
.auth-avatar-preview svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-avatar-change {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    border-radius: 50%;
    transition: opacity .2s;
    color: white;
    font-size: 18px;
}
.auth-avatar-picker:hover .auth-avatar-change { opacity: 1; }

.auth-avatar-info { flex: 1; min-width: 0; }
.auth-avatar-label { font-size: 14px; font-weight: 600; color: #1e293b; margin-bottom: 2px; }
.auth-avatar-hint  { font-size: 12px; color: #64748b; margin-bottom: 10px; }
.auth-avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary, #10b981);
    cursor: pointer;
    border: 1.5px solid var(--primary, #10b981);
    border-radius: 8px;
    padding: 6px 14px;
    background: transparent;
    transition: all .2s;
}
.auth-avatar-btn:hover {
    background: var(--primary, #10b981);
    color: white;
}
.auth-avatar-input { display: none; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 980px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-panel-logo { display: inline-flex; }
    .auth-panel { padding: 32px 24px 48px; min-height: 100vh; }
}
@media (max-width: 480px) {
    .auth-panel { padding: 24px 18px 36px; }
    .auth-progress { margin-bottom: 24px; }
    .auth-grid-2 { grid-template-columns: 1fr; }
    .auth-title { font-size: 24px; }
    .auth-input { height: 50px; font-size: 16px; } /* >=16px = pas de zoom iOS */
    .auth-btn-primary { height: 52px; }
}

/* Sélecteur téléphonique — styles dans shared/assets/css/opd-phone-prefix.css */
