/*
 * AGENCE DISTINCTION — shared styles for public / auth pages
 * Used by: login, magic-link request, magic-link message, and legal pages.
 * Brand palette sampled from the login illustration: rose #b85463 · mauve #bba1a5
 */
:root {
    --rose:        #b85463;
    --rose-dark:   #9e4351;
    --rose-darker: #883946;
    --mauve:       #c2a9ad;
    --blush-top:   #fdf3f4;
    --blush-bot:   #f6e2e5;
    --ink:         #211b23;
    --ink-soft:    #4a414c;
    --muted:       #8a8089;
    --line:        #ead8dc;
    --white:       #ffffff;
    --focus:       rgba(184, 84, 99, .25);
    --radius:      12px;
    --shadow:      0 18px 50px rgba(136, 57, 70, .12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    background: var(--blush-top);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================== Brand logo (image) ===================== */
.brand-logo {
    display: block;
    width: clamp(190px, 20vw, 240px);
    height: auto;
    align-self: flex-start;
}
.brand-logo-link { display: inline-block; line-height: 0; text-decoration: none; }
.brand-logo-link--center { display: block; text-align: center; margin: 0 auto 1.5rem; }
.brand-logo-link--center .brand-logo { margin: 0 auto; width: clamp(170px, 45vw, 210px); }
.topbar .brand-logo { width: clamp(110px, 16vw, 135px); }

/* ===================== Auth shell ===================== */
.auth {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Left brand panel (login) */
.auth__brand {
    flex: 1 1 52%;
    background: var(--white);
    display: flex;
    flex-direction: column;
    padding: clamp(1.75rem, 4vw, 4rem);
    position: relative;
    z-index: 2;
}
.auth__hero {
    margin: auto;
    width: 100%;
    max-width: 480px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.auth__hero-title {
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0 0 .5rem;
    color: var(--ink);
}
.auth__hero-text {
    font-size: clamp(.95rem, 1.4vw, 1.05rem);
    color: var(--muted);
    margin: 0 0 1.75rem;
    line-height: 1.6;
}
.auth__art { width: 100%; max-width: 360px; height: auto; display: block; }

/* Right form panel (login) */
.auth__form {
    flex: 1 1 48%;
    background: linear-gradient(155deg, var(--blush-top) 0%, var(--blush-bot) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.75rem, 4vw, 4rem);
}

/* Single-column centered variant (magic-link request / message) */
.auth--center {
    background: linear-gradient(155deg, var(--blush-top) 0%, var(--blush-bot) 100%);
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 5vw, 3rem);
}

/* ===================== Card ===================== */
.auth-card { width: 100%; max-width: 400px; }
.auth-card--standalone {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: clamp(1.75rem, 4vw, 2.5rem);
    max-width: 420px;
}
.auth-card__title {
    font-size: clamp(1.2rem, 2.4vw, 1.5rem);
    font-weight: 700;
    text-align: center;
    margin: 0 0 1.75rem;
    color: var(--ink);
}
.auth-card__lead {
    text-align: center;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.6;
    margin: -1rem 0 1.5rem;
}
.auth-card__back { text-align: center; margin: 1.5rem 0 0; font-size: .92rem; }
.auth-card__back a { color: var(--rose-dark); font-weight: 600; text-decoration: none; }
.auth-card__back a:hover { text-decoration: underline; }

/* ===================== Fields ===================== */
.field { margin-bottom: 1.15rem; }
.field__label {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: .45rem;
}
.field__control {
    width: 100%;
    height: 48px;
    padding: 0 .9rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--white);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field__control::placeholder { color: #b6aeb4; }
.field__control:focus {
    outline: none;
    border-color: var(--rose);
    box-shadow: 0 0 0 4px var(--focus);
}
.field__password { position: relative; }
.field__password .field__control { padding-right: 3rem; }
.pw-toggle {
    position: absolute;
    top: 0; right: 0;
    width: 48px; height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #a89ca1;
    cursor: pointer;
    border-radius: 0 10px 10px 0;
    transition: color .15s ease;
}
.pw-toggle:hover { color: var(--rose-dark); }
.pw-toggle:focus-visible { outline: none; color: var(--rose-dark); box-shadow: 0 0 0 4px var(--focus); }
.pw-toggle svg { width: 20px; height: 20px; display: block; }
.pw-toggle .icon-off { display: none; }
.pw-toggle.is-on .icon-on { display: none; }
.pw-toggle.is-on .icon-off { display: block; }

/* ===================== Options row ===================== */
.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: .35rem 0 1.6rem;
}
.checkbox {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .92rem;
    color: var(--muted);
    cursor: pointer;
}
.checkbox input { width: 18px; height: 18px; accent-color: var(--rose); cursor: pointer; }
.link { color: var(--rose-dark); font-weight: 600; font-size: .92rem; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ===================== Button ===================== */
.btn-primary {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 10px;
    background: var(--rose);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background .15s ease, transform .06s ease;
}
.btn-primary:hover { background: var(--rose-dark); }
.btn-primary:active { background: var(--rose-darker); transform: translateY(1px); }
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }

/* ===================== Alerts ===================== */
.alert { border-radius: 10px; padding: .75rem 1rem; font-size: .9rem; margin-bottom: 1.25rem; }
.alert--error { background: #fdecec; border: 1px solid #f3c4c4; color: #98302f; }
.alert--success { background: #eaf6ee; border: 1px solid #bfe3cc; color: #1f6b3b; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert li + li { margin-top: .25rem; }

/* ===================== Footers / legal links ===================== */
.auth-card__footer {
    display: flex;
    justify-content: space-between;
    gap: .5rem 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    font-size: .78rem;
    color: var(--muted);
}
.auth-card__footer a { color: inherit; text-decoration: none; }
.auth-card__footer a:hover { color: var(--rose-dark); }
.legal-links {
    margin-top: 1.1rem;
    text-align: center;
    font-size: .76rem;
    line-height: 1.7;
    color: var(--muted);
}
.legal-links a { color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.legal-links a:hover { color: var(--rose-dark); text-decoration: underline; }
.legal-links .sep { margin: 0 .4rem; color: var(--line); }

/* ===================== Login: desktop diagonal seam ===================== */
@media (min-width: 992px) {
    .auth__brand {
        clip-path: polygon(0 0, 100% 0, calc(100% - 4.5vw) 100%, 0 100%);
        margin-right: -4.5vw;
        padding-right: calc(clamp(1.75rem, 4vw, 4rem) + 4.5vw);
    }
}

/* ===================== Login: stacked layout ===================== */
@media (max-width: 991px) {
    .auth { flex-direction: column; }
    .auth__brand {
        flex: 0 0 auto;
        clip-path: none;
        margin: 0;
        align-items: center;
        text-align: center;
        padding: 2.25rem 1.5rem 1.25rem;
    }
    .auth__brand .brand-logo { align-self: center; }
    .auth__hero { margin: 1.25rem auto 0; }
    .auth__art { max-width: 220px; }
    .auth__form { flex: 1 1 auto; padding: 1.75rem 1.5rem 2.5rem; }
}
@media (max-width: 560px) {
    .auth__hero-title { margin-top: .25rem; }
    .auth__art { display: none; }
}

/* ===================== Legal / public pages ===================== */
.page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem clamp(1.25rem, 5vw, 3rem);
    background: var(--white);
    border-bottom: 1px solid var(--line);
}
.topbar .brand-logo { font-size: 1.4rem; align-self: center; }
.topbar__back { color: var(--rose-dark); font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; }
.topbar__back:hover { text-decoration: underline; }

.legal {
    flex: 1 0 auto;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 5vw, 2rem);
    line-height: 1.7;
    color: var(--ink-soft);
}
.legal h1 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ink);
    margin: 0 0 1.5rem;
}
.legal h2 {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    font-weight: 700;
    color: var(--ink);
    margin: 2rem 0 .6rem;
}
.legal p { margin: 0 0 1rem; }
.legal ul { margin: 0 0 1rem; padding-left: 1.4rem; }
.legal li { margin-bottom: .4rem; }
.legal a { color: var(--rose-dark); font-weight: 600; }
.legal .legal__meta { color: var(--muted); font-size: .9rem; }

.page__footer {
    flex-shrink: 0;
    text-align: center;
    padding: 1.5rem;
    font-size: .8rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
    background: var(--white);
}

/* ===================== Reduced motion ===================== */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
