/*
 * File:        public/css/portal.css
 * Data:        2026-10-24
 * Versione:    0.1.0
 * Contesto:    Portale clienti - Fase F0 (F0-04, F0-06)
 * Descrizione: Stile del portale clienti (login e area riservata). CSS puro, senza dipendenze
 *              esterne ne font remoti (privacy e velocita). Palette da docs/branding/README.md.
 */

:root {
    --navy: #12263f;
    --navy-deep: #0b1b2e;
    --amber: #f5a623;
    --amber-dark: #c9831a;
    --teal: #19b5a5;
    --teal-dark: #0f8a7d;
    --slate: #5b6b7f;
    --mist: #9fb3c8;
    --line: #dde5ee;
    --paper: #f5f8fb;
    --danger: #b3261e;
    --radius: 14px;
    --font-ui: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-head: Poppins, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: var(--font-ui);
    color: var(--navy);
    background: var(--paper);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-dark); text-underline-offset: 3px; }
a:hover { color: var(--navy); }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }

/* ---------- Login: schermo diviso ---------- */

.auth {
    display: grid;
    grid-template-columns: minmax(320px, 5fr) 6fr;
    min-height: 100vh;
}

.auth__brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem clamp(2rem, 5vw, 4.5rem);
    color: #fff;
    background:
        radial-gradient(900px 520px at 85% -10%, rgba(25, 181, 165, 0.28), transparent 60%),
        radial-gradient(700px 480px at -10% 110%, rgba(245, 166, 35, 0.22), transparent 60%),
        linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
}

.auth__brand::after {
    /* Cerchio decorativo ispirato allo "0" del logo */
    content: "";
    position: absolute;
    right: -140px;
    bottom: -140px;
    width: 420px;
    height: 520px;
    border: 36px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.auth__logo { display: inline-flex; align-items: center; gap: 0.85rem; color: #fff; text-decoration: none; }
.auth__logo img { width: 58px; height: 58px; display: block; }
.auth__logo span { font-family: var(--font-head); font-weight: 700; font-size: 1.7rem; letter-spacing: -0.01em; }
.auth__logo span b { color: var(--amber); font-weight: 700; }

.auth__pitch { position: relative; z-index: 1; max-width: 30rem; }

.auth__pitch h1 {
    font-family: var(--font-head);
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    line-height: 1.15;
    margin: 0 0 1rem;
    letter-spacing: -0.01em;
}

.auth__pitch h1 em { font-style: normal; color: var(--amber); }

.auth__pitch p { color: var(--mist); margin: 0 0 1.5rem; font-size: 1.05rem; }

.auth__points { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }

.auth__points li {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    color: #e6eef7;
}

.auth__points li::before {
    content: "";
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 4px rgba(25, 181, 165, 0.2);
}

.auth__foot { position: relative; z-index: 1; color: var(--mist); font-size: 0.85rem; }

.auth__main {
    display: grid;
    place-items: center;
    padding: 2rem 1.25rem;
}

.card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.25rem 2rem;
    box-shadow: 0 1px 2px rgba(18, 38, 63, 0.04), 0 18px 40px -18px rgba(18, 38, 63, 0.25);
    animation: rise 0.45s ease both;
}

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) { .card { animation: none; } }

.card h2 { font-family: var(--font-head); font-size: 1.5rem; margin: 0 0 0.35rem; }
.card .lead { color: var(--slate); margin: 0 0 1.5rem; }

/* ---------- Schede (password / link magico) ---------- */

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; padding: 0.25rem; background: var(--paper); border-radius: 10px; margin-bottom: 1.5rem; }

.tabs button {
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--slate);
    background: transparent;
    border: 0;
    padding: 0.6rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.tabs button[aria-selected="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(18, 38, 63, 0.15); }

[role="tabpanel"][hidden], .tabs[hidden] { display: none; }

/* ---------- Form ---------- */

.field { margin-bottom: 1.1rem; }

.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }

.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
    width: 100%;
    font: inherit;
    color: var(--navy);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:hover { border-color: var(--mist); }

.field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(25, 181, 165, 0.18); }

.check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; color: var(--slate); margin-bottom: 1.25rem; }

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    font: inherit;
    font-weight: 700;
    color: var(--navy);
    background: var(--amber);
    border: 0;
    border-radius: 10px;
    padding: 0.85rem 1.2rem;
    cursor: pointer;
    transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
    box-shadow: 0 6px 16px -8px rgba(245, 166, 35, 0.9);
}

.btn:hover { background: #ffb43a; transform: translateY(-1px); }
.btn:active { transform: none; }

.btn--ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); box-shadow: none; }
.btn--ghost:hover { background: var(--paper); transform: none; }

.alert { padding: 0.8rem 1rem; border-radius: 10px; margin-bottom: 1.2rem; font-size: 0.93rem; }
.alert--error { background: #fdecea; color: var(--danger); border: 1px solid #f5c2be; }
.alert--ok { background: #e6f7f5; color: var(--teal-dark); border: 1px solid #b7e6e0; }

.error { color: var(--danger); font-size: 0.85rem; margin-top: 0.3rem; }

.card__foot { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--slate); text-align: center; }

/* ---------- Area riservata ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem clamp(1rem, 4vw, 2.5rem);
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.topbar img { height: 36px; width: auto; display: block; }

.topbar__user { display: flex; align-items: center; gap: 1rem; font-size: 0.92rem; color: var(--slate); }

.topbar__user form { margin: 0; }

.topbar__user .btn { width: auto; padding: 0.5rem 1rem; font-size: 0.88rem; }

.page { max-width: 960px; margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 2rem); }

.page h1 { font-family: var(--font-head); font-size: 1.9rem; margin: 0 0 0.4rem; }

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-top: 1.5rem;
}

.badge { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 999px; background: #e6f7f5; color: var(--teal-dark); }

@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth__brand { padding: 1.75rem 1.5rem; gap: 1.5rem; }
    .auth__brand::after { display: none; }
    .auth__logo img { width: 44px; height: 44px; }
    .auth__logo span { font-size: 1.35rem; }
    .auth__pitch h1 { font-size: 1.5rem; }
    .auth__points, .auth__foot { display: none; }
    .card { padding: 1.75rem 1.4rem; }
}
