/* Portail : inscription, connexion, espace client et back-office. S'appuie sur app.css. */

/* ---------- Pages de connexion et d'inscription ---------- */
.has-light-header main.auth { padding-top: 0; }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100svh; }
.auth em, .dashboard em { font-style: italic; font-weight: 500; }

.auth-visual { position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--surface-2); color: var(--ink); }
.auth-visual > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-visual-content { position: absolute; right: clamp(1rem, 2.5vw, 2rem); bottom: clamp(1rem, 2.5vw, 2rem); left: clamp(1rem, 2.5vw, 2rem); z-index: 1; display: grid; gap: 1rem; max-width: 30rem; }
.auth-logo { width: 136px; height: auto; }
.auth-quote { max-width: 22ch; font-family: var(--font-display); font-size: clamp(1.4rem, 2vw, 1.9rem); font-weight: 600; line-height: 1.15; }
.auth-benefits { display: grid; gap: .8rem; max-width: 28rem; margin: 0; padding: 0; list-style: none; font-size: .95rem; }
.auth-benefits li { display: flex; align-items: center; gap: .75rem; }
.auth-benefits span { display: grid; place-items: center; flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--accent); }
.auth-caption { color: var(--muted); font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

.auth-panel { display: grid; place-items: center; padding: calc(var(--header-h) + 3rem) var(--gutter) 3.5rem; }
.auth-card { width: min(100%, 34rem); }
.auth h1 { font-size: clamp(2.1rem, 3.4vw, 2.9rem); }
.auth-lead { margin-top: .8rem; color: var(--muted); font-size: 1.05rem; }

.dashboard .flash { margin: 0 0 1.5rem; }

/* ---------- Formulaires ---------- */
.auth-form { display: grid; gap: 1.15rem; margin-top: 1.8rem; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; align-content: start; gap: .4rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.field label, .field legend { font-size: .92rem; font-weight: 700; }
.field legend { margin-bottom: .5rem; padding: 0; }
.field-optional { color: var(--muted); font-size: .82rem; font-weight: 500; }
.field-hint { margin-top: -.15rem; color: var(--muted); font-size: .82rem; }
.field-control { position: relative; }
.field input:not([type="checkbox"], [type="radio"]) { width: 100%; min-height: 50px; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: .9rem; background: white; color: var(--ink); font: inherit; transition: border-color .25s, box-shadow .25s; }
.field input::placeholder { color: #8a8a8a; }
.field input:hover { border-color: #b9c3d6; }
.field input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 4px #00000017; }
.field input[aria-invalid="true"] { border-color: var(--accent); }
.field input[type="password"], .field input[data-password] { padding-right: 3.2rem; }
.field-toggle { position: absolute; top: 50%; right: .35rem; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: .7rem; background: none; color: var(--muted); cursor: pointer; transform: translateY(-50%); }
.field-toggle:hover, .field-toggle[aria-pressed="true"] { color: var(--ink); background: #0000000a; }
.field-error { display: flex; gap: .5rem; color: var(--ink); font-size: .86rem; font-weight: 600; }
.field-error::before { content: ""; flex: none; width: .45rem; height: .45rem; margin-top: .5em; border-radius: 50%; background: var(--accent); }

.profile-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.profile-option { position: relative; }
.profile-option input { position: absolute; opacity: 0; pointer-events: none; }
.profile-option span { display: flex; align-items: center; gap: .6rem; height: 100%; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: .9rem; font-size: .9rem; font-weight: 600; line-height: 1.3; cursor: pointer; transition: border-color .25s, background-color .25s, box-shadow .25s; }
.profile-option span::before { content: ""; flex: none; width: 1rem; height: 1rem; border: 1.5px solid #b9c3d6; border-radius: 50%; transition: border .25s, background .25s; }
.profile-option:hover span { border-color: #b9c3d6; }
.profile-option input:checked + span { border-color: var(--ink); background: #00000008; box-shadow: inset 0 0 0 1px var(--ink); }
.profile-option input:checked + span::before { border: 5px solid var(--ink); }
.profile-option input:focus-visible + span { outline: 3px solid #2b6bff; outline-offset: 2px; }

.checkbox { display: flex; align-items: flex-start; gap: .7rem; color: var(--muted); font-size: .9rem; font-weight: 500 !important; line-height: 1.5; cursor: pointer; }
.checkbox input { flex: none; width: 1.15rem; height: 1.15rem; margin-top: .15rem; accent-color: var(--ink); }
.checkbox a { color: var(--ink); font-weight: 700; }

.auth-submit { width: 100%; min-height: 54px; margin-top: .4rem; font-size: 1.02rem; }
.auth-submit:disabled { opacity: .5; cursor: not-allowed; }
.auth-forgot { margin-top: -.3rem; color: var(--muted); font-size: .88rem; }
.auth-forgot a, .auth-switch a { color: var(--ink); font-weight: 700; }
.auth-switch { margin-top: 1.6rem; color: var(--muted); text-align: center; }

/* ---------- Espace client et back-office ---------- */
.dashboard { padding-bottom: clamp(3.5rem, 7vw, 6rem); }
.dashboard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding-block: clamp(1.5rem, 4vw, 3rem) 2rem; }
.dashboard-identity { display: flex; align-items: center; gap: 1.2rem; }
.avatar { display: grid; place-items: center; flex: none; width: 4.2rem; height: 4.2rem; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; box-shadow: 0 0 0 5px #00000014; }
.dashboard h1 { font-size: clamp(2rem, 3.4vw, 2.8rem); }
.dashboard-profile { margin-top: .3rem; color: var(--muted); }
.dashboard-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 1rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.module { position: relative; display: grid; align-content: start; gap: .5rem; height: 100%; padding: 1.5rem; border-radius: 1.4rem; text-decoration: none; transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out); }
a.module:hover { transform: translateY(-4px); box-shadow: inset 0 1px 0 #fff, 0 26px 50px #00000021; }
.module h2 { font-size: 1.3rem; }
.module p { color: var(--muted); font-size: .95rem; }
.module-icon { display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: .5rem; border-radius: .9rem; background: var(--red-wash); color: var(--accent); }
.module.is-soon .module-icon { background: var(--surface-2); color: var(--ink); }
.module.is-soon { opacity: .8; }
.module-badge { position: absolute; top: 1.2rem; right: 1.2rem; padding: .25rem .65rem; border-radius: 100vmax; background: #0000000d; font-size: .75rem; font-weight: 700; }
.account { padding: 1.6rem; border-radius: 1.4rem; }
.account h2 { font-size: 1.4rem; }
.account dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); gap: 1.1rem; margin: 1.1rem 0 0; }
.account dt { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.account dd { margin: .2rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.table-scroll { margin-top: 1rem; overflow-x: auto; }
.account table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.account th, .account td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.account th { color: var(--muted); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- Adaptation ---------- */
@media (max-width: 62rem) {
    .auth { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-panel { place-items: start center; }
}

@media (max-width: 34rem) {
    .field-row, .profile-options { grid-template-columns: 1fr; }
    .auth-panel { padding-top: calc(var(--header-h) + 2rem); }
    .dashboard-head form { width: 100%; }
    .dashboard-head .button { width: 100%; }
}
.auth-help { margin-top: .8rem; text-align: center; }
