:root {
    --color-primary: #E85D04;
    --color-primary-deep: #C24C02;
    --color-primary-soft: #F07A1A;
    --color-primary-tint: #FDEBDD;
    --color-primary-tint-2: #FEF5EE;
    --color-bg: #F1EEE8;
    --color-surface: #FFFFFF;
    --color-border: #EAEAEA;
    --color-text: #333333;
    --color-text-muted: #8A8A8A;
    --color-success: #1E9E63;
    --color-success-tint: #E7F6EE;
    --color-danger: #D8452B;
    --color-danger-tint: #FCEAE6;
    --radius-pill: 100px;
    --radius-lg: 32px;
    --radius-md: 26px;
    --shadow-sm: 0 4px 10px rgba(60, 40, 20, .09), 0 10px 26px rgba(60, 40, 20, .10);
    --shadow-md: 0 6px 16px rgba(60, 40, 20, .10), 0 18px 40px rgba(60, 40, 20, .12);
    --shadow-orange: 0 8px 22px rgba(232, 93, 4, .32);
}

/*
 * Typographie et fond appliqués à tout le site : un changement à faible risque, aucun texte
 * de test ne porte sur une police ou une couleur. L'habillage complet — cartes, composants,
 * mise en page — reste circonscrit à .page-home et aux écrans d'authentification
 * (.page-login, .page-register, .page-forgot-password, .page-reset-password) ; le reste du
 * site garde sa structure HTML nue, désormais sur une base au moins lisible.
 */
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--color-text);
    background: radial-gradient(130% 100% at 12% 0%, #FEF5EE 0%, #F6F1EA 42%, #EFE8DF 100%);
}

h1, h2, h3, h4 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--color-primary-deep);
}

a {
    color: var(--color-primary-deep);
}

/* Lu par les lecteurs d'écran, invisible à l'affichage — jamais display:none, qui les retirerait aussi. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Empilé en superposition fixe : un message ne doit plus pousser le contenu d'une page héros. */
#toasts {
    position: fixed;
    top: 16px;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    pointer-events: none;
}

.flash {
    padding: .7rem 1.1rem;
    border-radius: 14px;
    border: 1px solid;
    box-shadow: var(--shadow-sm);
    font-size: 14.5px;
    font-weight: 600;
    max-width: 420px;
    pointer-events: auto;
}

.flash-error {
    color: #82071e;
    background-color: #ffebe9;
    border-color: #ff818266;
}

.flash-success {
    color: #0a3622;
    background-color: #dafbe1;
    border-color: #2da44e66;
}

.form-error,
.error-message {
    color: #82071e;
}

/* ---------- Composants partagés par les écrans héros ---------- */

/* width:100% sans max-width, comme .phone-cta du prototype : le bouton doit atteindre
   le même bord que .field-glass au-dessus de lui, jamais s'arrêter avant. */
.btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 56px;
    padding: 0 24px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-weight: 700;
    font-size: 16px;
    box-shadow: var(--shadow-orange);
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .2s ease;
}

.btn-hero:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(232, 93, 4, .4);
}

.btn-hero svg {
    width: 18px;
    height: 18px;
}

/* Même flèche nue que .btn-hero, aucune pastille sur aucun CTA du prototype. */
.btn-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 360px;
    height: 56px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-weight: 600;
    font-size: 16px;
    box-shadow: var(--shadow-orange);
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: transform .15s ease, box-shadow .2s ease;
}

.btn-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(232, 93, 4, .4);
}

.btn-start svg {
    width: 18px;
    height: 18px;
}

.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0C0B0A;
}

.hero-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-back {
    position: absolute;
    z-index: 3;
    top: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    text-decoration: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hero-back svg {
    width: 22px;
    height: 22px;
}

/* ---------- Page d'accueil ---------- */

.page-home .hero-veil {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(10, 8, 6, .55) 0%, rgba(10, 8, 6, .05) 30%, rgba(10, 8, 6, .35) 68%, rgba(12, 11, 10, .92) 100%);
}

.page-home .hero-top {
    position: relative;
    z-index: 2;
    padding: 28px 28px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lang-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: var(--radius-pill);
    color: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 32px 8px 14px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}

.lang-select option {
    color: var(--color-text);
    background: var(--color-surface);
}

.lang-select option:disabled {
    color: var(--color-text-muted);
}

.page-home .brand-mark img {
    height: 40px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .55));
}

.page-home .hero-bottom {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: 0 28px calc(40px + env(safe-area-inset-bottom, 0));
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 22px;
}

.page-home .hero-tagline {
    font-weight: 700;
    font-size: 26px;
    line-height: 1.25;
    color: var(--color-primary-tint);
    text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
    margin: 0;
    max-width: 420px;
}

.page-home .hero-tagline em {
    font-style: normal;
    color: var(--color-primary-soft);
}

.page-home .hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.page-home .hero-secondary {
    color: rgba(255, 255, 255, .82);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Écrans d'authentification (connexion, inscription, mot de passe) ---------- */

.page-login .hero-veil,
.page-register .hero-veil,
.page-forgot-password .hero-veil,
.page-reset-password .hero-veil {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(10, 8, 6, .62) 0%, rgba(10, 8, 6, .24) 34%, rgba(10, 8, 6, .74) 72%, rgba(10, 8, 6, .94) 100%);
}

/* Même ligne que .hero-back (écran authPhone du prototype : logo centré à top:14px, à
   côté du bouton retour), pas empilé dessous. Partagé par tout le flux d'authentification. */
.page-login .hero-logo,
.page-register .hero-logo,
.page-forgot-password .hero-logo,
.page-reset-password .hero-logo {
    position: absolute;
    z-index: 3;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    height: 32px;
    width: auto;
}

/* max-width + margin auto, comme .start-body : le prototype ne connaît que le viewport
   d'un téléphone, donc rien n'y centre le panneau — sans ça il colle au bord gauche sur
   un écran large. */
.login-panel {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 24px calc(32px + env(safe-area-inset-bottom, 0));
}

.login-panel h1 {
    color: #fff;
    font-size: 26px;
    margin: 0 0 4px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}

.login-panel .login-sub {
    color: rgba(255, 255, 255, .78);
    font-size: 14.5px;
    margin: 0 0 20px;
}

.login-panel form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 420px;
}

.field-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
    margin: 0 4px 6px;
}

.field-glass {
    width: 100%;
    height: 50px;
    padding: 0 18px;
    box-sizing: border-box;
    border: 1.5px solid rgba(255, 255, 255, .28);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .13);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 14.5px;
    outline: none;
    transition: .15s;
}

.field-glass::placeholder {
    color: rgba(255, 255, 255, .55);
}

.field-glass:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(232, 93, 4, .3);
}

.field-group .help-text {
    margin: 6px 4px 0;
    font-size: 12px;
    color: rgba(255, 255, 255, .7);
}

/* Chip opaque : le texte de .form-error reste rouge foncé, illisible tel quel sur une photo. */
.page-login .form-error,
.page-register .form-error,
.page-forgot-password .form-error,
.page-reset-password .form-error {
    display: inline-block;
    background: rgba(255, 255, 255, .94);
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    margin: 0;
}

/* form_row rend l'erreur avant le champ (thème par défaut) : un peu d'écart avant
   .field-glass, sans quoi le chip colle au bord du champ suivant. */
.field-group .form-error {
    margin: 0 0 8px;
}

.login-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
}

.login-security svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.login-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 22px;
    font-size: 13.5px;
}

.login-links a {
    color: rgba(255, 255, 255, .85);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Écran de connexion admin (ADR 0054) ---------- */
/* Fond plein, sans photo : signale volontairement que ce n'est pas l'écran public. */

.admin-login-screen {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.admin-login-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px 32px;
    text-align: center;
}

.admin-login-mark {
    height: 34px;
    width: auto;
    margin: 0 auto 18px;
    display: block;
}

.admin-login-card h1 {
    font-size: 21px;
    margin: 0 0 4px;
}

.admin-login-sub {
    color: var(--color-text-muted);
    font-size: 13.5px;
    margin: 0 0 24px;
}

.admin-login-card form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.admin-login-card .field-group label {
    color: var(--color-text-muted);
    text-transform: none;
    letter-spacing: normal;
    font-size: 13px;
    font-weight: 600;
}

.field-plain {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    box-sizing: border-box;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 14.5px;
    outline: none;
    transition: .15s;
}

.field-plain:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-tint);
}

.admin-login-card .btn-hero {
    margin-top: 6px;
}

.admin-login-card .form-error {
    color: #82071e;
    background: var(--color-danger-tint);
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
}

.admin-login-links {
    margin-top: 20px;
    font-size: 13.5px;
}

.admin-login-links a {
    color: var(--color-text-muted);
}

/* ---------- Écran de choix client / partenaire (/commencer) ---------- */

.start-banner {
    position: relative;
    height: 220px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0C0B0A;
}

.start-banner-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
}

.start-body {
    max-width: 560px;
    margin: 0 auto;
    padding: 32px 24px 56px;
}

.start-body h1 {
    font-size: 22px;
    text-align: center;
    margin: 0 0 24px;
}

/*
 * Grandes cartes, photo qui déborde sur la moitié droite (assets/auth-login-w2.png du
 * prototype) : la photo est en position absolue plein-hauteur, un dégradé la fait fondre
 * dans le fond de la carte, et le texte reste au-dessus dans le flux normal.
 */
.mode-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 128px;
    overflow: hidden;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    padding-right: 40%;
    text-decoration: none;
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .2s ease;
}

.mode-card + .mode-card {
    margin-top: 16px;
}

.mode-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.mode-card-chevron {
    position: relative;
    z-index: 2;
    width: 20px;
    height: 20px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.mode-card-text {
    position: relative;
    z-index: 2;
    min-width: 0;
}

.mode-card-text b {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-weight: 800;
    font-size: 16px;
    color: var(--color-primary);
}

.mode-card-text span {
    display: block;
    font-size: 13.5px;
    color: var(--color-primary);
    margin-top: 4px;
}

.mode-card-photo {
    position: absolute;
    z-index: 0;
    right: 0;
    top: 0;
    width: 48%;
    height: 100%;
    object-fit: cover;
}

.mode-card::after {
    content: '';
    position: absolute;
    z-index: 1;
    right: 0;
    top: 0;
    width: 48%;
    height: 100%;
    background: linear-gradient(90deg, var(--color-surface) 0%, transparent 55%);
}

.mode-card-partner {
    background: linear-gradient(120deg, var(--color-primary-soft), var(--color-primary));
    border-color: transparent;
}

.mode-card-partner::after {
    background: linear-gradient(90deg, var(--color-primary-soft) 0%, transparent 55%);
}

.mode-card-partner .mode-card-text b,
.mode-card-partner .mode-card-text span {
    color: #fff;
}

.mode-card-partner .mode-card-text span {
    color: rgba(255, 255, 255, .9);
}

.mode-card-partner .mode-card-chevron {
    color: #fff;
}

/*
 * Masqué pour le moment, sur demande : le contenu reste dans le DOM (FooterTest continue de
 * suivre les trois liens), seul l'affichage change. Retirer cette règle pour le remontrer.
 */
footer[data-legal] {
    display: none;
}
