/* ============================================================
   auth.css — Tunnel d'authentification (identité Convention, dark premium)
   Palette alignée sur convention-solutions.com : fond quasi-noir,
   cyan #1fd5f9 en accent, texte crème, titres Instrument Serif.
   ============================================================ */

:root {
    /* Brand — accent = cyan Convention */
    --auth-brand-deep:   #1fd5f9;
    --auth-brand-deep-2: #6ae3fb;
    --auth-brand-card:   #10151e;
    --auth-accent-orange: #fa8638;
    --auth-accent-yellow: #b7e236;

    /* Surfaces (dark) */
    --auth-page-bg:       #070a0f;
    --auth-card-bg:       #10151e;
    --auth-brand-card-bg: #0d131e;

    /* Text (clair sur fond sombre) */
    --auth-text:           #f7f5f3;
    --auth-text-secondary: #aeb6c2;
    --auth-text-tertiary:  #6b7280;
    --auth-text-on-brand:  #06222b;  /* texte sombre posé sur le cyan */

    /* Borders (blanc alpha) */
    --auth-border:        rgba(247, 245, 243, 0.12);
    --auth-border-strong: rgba(247, 245, 243, 0.24);
    --auth-divider:       rgba(247, 245, 243, 0.08);

    /* Feedback */
    --auth-danger:    #ff6b6b;
    --auth-danger-bg: rgba(220, 38, 38, 0.16);
    --auth-success:   #4ade80;

    /* Tags — dégradé multicolore de la marque */
    --auth-tag-orange: #fa8638;
    --auth-tag-green:  #b7e236;
    --auth-tag-blue:   #1fd5f9;
    --auth-tag-pink:   #f36896;
    --auth-tag-yellow: #9b63e9;

    /* Radius / shadow (glow cyan) */
    --auth-radius-card:  16px;
    --auth-radius-brand: 24px;
    --auth-radius-input: 12px;
    --auth-radius-pill:  999px;
    --auth-shadow-card:  0 1px 0 rgba(247, 245, 243, 0.05) inset, 0 24px 60px -24px rgba(0, 0, 0, 0.85);
    --auth-shadow-brand: 0 0 80px rgba(31, 213, 249, 0.22), 0 28px 60px -24px rgba(0, 0, 0, 0.7);

    /* Type */
    --auth-font-sans:  "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --auth-font-serif: "Instrument Serif", "DM Serif Display", Georgia, serif;
}

/* ---------- Reset minimal ---------- */
body.auth-body,
body.auth-body *,
body.auth-body *::before,
body.auth-body *::after {
    box-sizing: border-box;
}

body.auth-body {
    background:
        radial-gradient(ellipse 90% 55% at 20% -5%, rgba(31, 213, 249, 0.12), transparent 60%),
        radial-gradient(ellipse 70% 50% at 95% 110%, rgba(155, 99, 233, 0.10), transparent 60%),
        var(--auth-page-bg);
    background-attachment: fixed;
    font-family: var(--auth-font-sans);
    color: var(--auth-text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.auth-body .animated-bg,
body.auth-body header.app-header,
body.auth-body .navbar {
    display: none !important;
}

/* ---------- Header de page ---------- */
.auth-topbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 24px;
    font-size: 14px;
    color: var(--auth-text);
}

@media (min-width: 768px) {
    .auth-topbar { padding: 20px 40px; gap: 24px; }
}

.auth-topbar a {
    color: var(--auth-text);
    text-decoration: none;
    font-weight: 500;
}

.auth-topbar a:hover { color: var(--auth-brand-deep); }

.auth-lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--auth-radius-pill);
    cursor: pointer;
    user-select: none;
    color: var(--auth-text-secondary);
}
.auth-lang:hover { background: rgba(247, 245, 243, 0.06); }
.auth-lang .auth-lang-current { color: var(--auth-text); font-weight: 600; }
.auth-lang .auth-lang-other   { color: var(--auth-text-tertiary); }
.auth-lang .auth-lang-caret   { font-size: 10px; color: var(--auth-text-tertiary); margin-left: 2px; }

/* ---------- Conteneur split ---------- */
.auth-split {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 64px;
    padding: 24px 64px 40px;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 1024px) {
    .auth-split {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 16px 16px 32px;
    }
    .auth-brand-panel { display: none; }
    .auth-right-panel { justify-self: center; align-items: center; }
}

/* ---------- Panneau brand (gauche) ---------- */
.auth-brand-panel {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 560px;
    justify-self: end;
    width: 100%;
}

.auth-brand-card {
    background: var(--auth-brand-card-bg);
    border-radius: var(--auth-radius-brand);
    padding: 56px 48px;
    box-shadow: var(--auth-shadow-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    color: var(--auth-accent-yellow);
}

.auth-brand-card img,
.auth-brand-card svg {
    max-width: 100%;
    height: auto;
    max-height: 120px;
}

.auth-brand-tagline {
    font-family: var(--auth-font-serif);
    font-size: clamp(28px, 3.6vw, 44px);
    font-weight: 400;
    line-height: 1.15;
    color: var(--auth-text);
    margin: 0;
    letter-spacing: -0.5px;
}

.auth-brand-tagline em {
    color: var(--auth-accent-orange);
    font-style: italic;
}

.auth-brand-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--auth-text-secondary);
    margin: 0;
    max-width: 460px;
}

.auth-brand-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-pill);
    font-size: 13px;
    color: var(--auth-text);
    background: var(--auth-card-bg);
}
.auth-tag::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--auth-text-tertiary);
}
.auth-tag.is-orange::before { background: var(--auth-tag-orange); }
.auth-tag.is-green::before  { background: var(--auth-tag-green); }
.auth-tag.is-blue::before   { background: var(--auth-tag-blue); }
.auth-tag.is-pink::before   { background: var(--auth-tag-pink); }
.auth-tag.is-yellow::before { background: var(--auth-tag-yellow); }

/* ---------- Panneau auth (droite) ---------- */
.auth-right-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    max-width: 460px;
    width: 100%;
    justify-self: start;
    position: relative;
}

@media (max-width: 1024px) {
    .auth-brand-panel,
    .auth-right-panel {
        justify-self: center;
        align-items: center;
    }
}

/* Petits points décoratifs autour de la carte */
.auth-dots {
    position: absolute;
    width: 80px;
    height: 60px;
    background-image: radial-gradient(var(--auth-border-strong) 1.5px, transparent 1.5px);
    background-size: 12px 12px;
    opacity: 0.6;
    pointer-events: none;
}
.auth-dots-tl { top: -32px; left: -32px; }
.auth-dots-br { bottom: -32px; right: -32px; }

.auth-card {
    width: 100%;
    background: var(--auth-card-bg);
    border-radius: var(--auth-radius-card);
    box-shadow: var(--auth-shadow-card);
    overflow: hidden;
    position: relative;
}

/* En-tête "Connexion à Convention" + pill URL */
.auth-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--auth-divider);
    background: rgba(247, 245, 243, 0.03);
    flex-wrap: wrap;
}

@media (min-width: 480px) {
    .auth-card-header { padding: 16px 24px; }
}

.auth-card-header-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--auth-brand-deep);
    color: var(--auth-accent-yellow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.auth-card-header-icon img { width: 100%; height: 100%; object-fit: cover; }

.auth-card-header-text {
    font-size: 14px;
    color: var(--auth-text);
    flex: 1 1 auto;
    line-height: 1.3;
}
.auth-card-header-text strong { font-weight: 600; }

.auth-card-header-url {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-pill);
    background: var(--auth-card-bg);
    color: var(--auth-text-secondary);
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Corps de carte */
.auth-card-body {
    padding: 28px 24px 24px;
}

@media (min-width: 480px) {
    .auth-card-body { padding: 32px 36px 28px; }
}

.auth-title {
    font-family: var(--auth-font-serif);
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 400;
    line-height: 1.15;
    color: var(--auth-text);
    margin: 0 0 8px;
    letter-spacing: -0.3px;
    word-break: break-word;
}

.auth-subtitle {
    font-size: 14px;
    line-height: 1.5;
    color: var(--auth-text-secondary);
    margin: 0 0 24px;
}
.auth-subtitle strong { color: var(--auth-text); font-weight: 600; }

.auth-helper {
    font-size: 13px;
    color: var(--auth-text-secondary);
    margin: 0 0 16px;
}

/* ---------- Chip compte (étape mot de passe) ---------- */
.auth-account-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    margin: 0 0 24px 0;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-pill);
    background: var(--auth-card-bg);
    color: var(--auth-text);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, border-color .15s;
}
.auth-account-chip:hover {
    background: rgba(247, 245, 243, 0.05);
    border-color: var(--auth-border-strong);
    color: var(--auth-text);
    text-decoration: none;
}
.auth-account-chip-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--auth-brand-deep);
    color: var(--auth-text-on-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}
.auth-account-chip-arrow {
    margin-left: 4px;
    color: var(--auth-text-tertiary);
    font-size: 11px;
}

/* ---------- Champs ---------- */
.auth-field {
    position: relative;
    margin-bottom: 12px;
}

.auth-field input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    font-size: 15px;
    font-family: var(--auth-font-sans);
    color: var(--auth-text);
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-input);
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.auth-field input::placeholder { color: var(--auth-text-tertiary); }
.auth-field input:hover { border-color: var(--auth-border-strong); }

.auth-field input:focus {
    border-color: var(--auth-brand-deep);
    box-shadow: 0 0 0 3px rgba(31, 213, 249, 0.18);
}

.auth-field.has-error input {
    border-color: var(--auth-danger);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.16);
}

.auth-field-error {
    display: block;
    color: var(--auth-danger);
    font-size: 12px;
    line-height: 1.4;
    margin: 6px 4px 0;
}

.auth-field-help {
    display: block;
    color: var(--auth-text-secondary);
    font-size: 12px;
    line-height: 1.4;
    margin: 6px 4px 0;
}

.auth-field-password { position: relative; }
.auth-toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: var(--auth-text-tertiary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.auth-toggle-password:hover { background: rgba(247, 245, 243, 0.06); color: var(--auth-text); }

/* ---------- Liens en ligne (Identifiant oublié) ---------- */
.auth-inline-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--auth-brand-deep);
    text-decoration: none;
    font-weight: 500;
}
.auth-inline-link:hover { text-decoration: underline; color: var(--auth-brand-deep-2); }

/* ---------- Checkbox ---------- */
.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    font-size: 13px;
    color: var(--auth-text);
    cursor: pointer;
    user-select: none;
}
.auth-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--auth-brand-deep);
    cursor: pointer;
}

/* ---------- Boutons ---------- */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    font-family: var(--auth-font-sans);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--auth-radius-input);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, box-shadow .15s, border-color .15s, color .15s;
}
.auth-btn:focus-visible {
    outline: 2px solid var(--auth-brand-deep);
    outline-offset: 2px;
}

.auth-btn-primary {
    background: var(--auth-brand-deep);
    color: var(--auth-text-on-brand);
    width: 100%;
    box-shadow: 0 0 24px rgba(31, 213, 249, 0.28);
}
.auth-btn-primary:hover {
    background: var(--auth-brand-deep-2);
    color: var(--auth-text-on-brand);
    box-shadow: 0 0 34px rgba(31, 213, 249, 0.42);
}
.auth-btn-primary[disabled],
.auth-btn-primary.is-loading {
    background: rgba(247, 245, 243, 0.14);
    color: var(--auth-text-tertiary);
    box-shadow: none;
    cursor: not-allowed;
}

.auth-btn-text {
    background: transparent;
    color: var(--auth-brand-deep);
    height: auto;
    padding: 6px 8px;
    font-weight: 500;
}
.auth-btn-text:hover { color: var(--auth-brand-deep-2); text-decoration: underline; }

/* ---------- Séparateur OU ---------- */
.auth-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--auth-text-tertiary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.auth-or::before, .auth-or::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--auth-divider);
}

/* ---------- SSO grid ---------- */
.auth-sso-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}

@media (max-width: 360px) {
    .auth-sso-grid { grid-template-columns: 1fr; }
}

.auth-sso-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    padding: 0 12px;
    background: var(--auth-card-bg);
    color: var(--auth-text);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-input);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.auth-sso-btn:hover {
    background: rgba(247, 245, 243, 0.05);
    border-color: var(--auth-border-strong);
    color: var(--auth-text);
}
.auth-sso-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}
.auth-sso-btn .auth-sso-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---------- Bandeau erreur ---------- */
.auth-alert {
    background: var(--auth-danger-bg);
    color: var(--auth-danger);
    border-radius: var(--auth-radius-input);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.4;
}
.auth-alert ul { margin: 0; padding-left: 18px; }

/* ---------- Pied carte ---------- */
.auth-card-footer {
    text-align: center;
    padding: 16px 36px 24px;
    font-size: 13px;
    color: var(--auth-text-secondary);
}
.auth-card-footer a {
    color: var(--auth-brand-deep);
    font-weight: 600;
    text-decoration: none;
}
.auth-card-footer a:hover { text-decoration: underline; }

/* ---------- Pied de panneau droit (légal + version) ---------- */
.auth-right-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 4px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--auth-text-tertiary);
}
.auth-right-footer a {
    color: var(--auth-text-tertiary);
    text-decoration: none;
    margin: 0 8px;
}
.auth-right-footer a:hover { color: var(--auth-text-secondary); }
.auth-right-footer-links { display: flex; align-items: center; }
.auth-right-footer-links span { color: var(--auth-border-strong); }

/* ---------- Pied de page global ---------- */
.auth-page-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px 24px;
    font-size: 12px;
    color: var(--auth-text-tertiary);
}

@media (min-width: 768px) {
    .auth-page-footer { padding: 16px 40px 24px; }
}
.auth-page-footer-brand::before {
    content: "•";
    color: var(--auth-accent-orange);
    margin-right: 6px;
}
.auth-page-footer a {
    color: var(--auth-text-tertiary);
    text-decoration: none;
    margin: 0 8px;
}
.auth-page-footer a:hover { color: var(--auth-text-secondary); }

/* ---------- Multi-step ---------- */
.auth-step { display: none; }
.auth-step.is-active { display: block; }

/* ---------- Icône en-tête (clé, cadenas...) ---------- */
.auth-icon-head {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
    color: var(--auth-brand-deep);
    font-size: 40px;
}
.auth-icon-head.is-danger { color: var(--auth-danger); }
.auth-icon-head.is-success { color: var(--auth-success); }

/* ---------- OTP ---------- */
.auth-otp-input {
    text-align: center;
    letter-spacing: 0.5em;
    font-variant-numeric: tabular-nums;
    font-size: 22px !important;
}

/* ---------- ASP.NET validation summary ---------- */
.auth-card .text-danger { color: var(--auth-danger); }
