/* ---------------------------------------------------------------------
 * Percorso : /foresteria/public/css/style.css
 * File     : style.css
 * Versione : 1.4.0
 * Scopo    : Stile glassmorphism (tema scuro, accento neon ciano).
 *            Personalizza accento/sfondo dalle variabili in :root.
 * --------------------------------------------------------------------- */

:root {
    --accent: #06b6d4;
    --accent-soft: rgba(6, 182, 212, 0.18);
    --accent-strong: #22d3ee;
    --bg-1: #0f2027;
    --bg-2: #203a43;
    --bg-3: #2c5364;

    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.18);
    --field-bg: rgba(255, 255, 255, 0.08);
    --field-border: rgba(255, 255, 255, 0.20);

    --text: #f1f5f9;
    --text-dim: rgba(241, 245, 249, 0.65);
    --text-faint: rgba(241, 245, 249, 0.45);

    --ok: #34d399;
    --ok-bg: rgba(52, 211, 153, 0.16);
    --ko: #f87171;
    --ko-bg: rgba(248, 113, 113, 0.16);
    --warn: #fbbf24;
    --warn-bg: rgba(251, 191, 36, 0.16);

    --radius: 14px;
    --radius-sm: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Blob decorativi sfocati */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    z-index: 0;
    pointer-events: none;
}
.blob-a { width: 360px; height: 360px; background: rgba(34, 211, 238, 0.30); top: -120px; right: -80px; }
.blob-b { width: 320px; height: 320px; background: rgba(45, 138, 221, 0.28); bottom: -120px; left: -90px; }

.wrap {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin: 0 auto;
    padding: 48px 20px 64px;
}
.wrap.narrow { max-width: 560px; }

.intro { margin-bottom: 22px; }
.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    color: var(--accent-strong);
}
h1 { margin: 0 0 8px; font-size: 28px; font-weight: 600; }
.sub { margin: 0; color: var(--text-dim); font-size: 15px; }

/* Pannello glass */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
}
.card { padding: 28px; }
.center { text-align: center; }

/* Form */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}
.field { margin-bottom: 16px; }
.field label,
.label-block {
    display: block;
    font-size: 12.5px;
    color: var(--text-dim);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}
.label-block { margin-top: 8px; margin-bottom: 10px; }

/* Link e modale "Mappa dei letti" */
.link-mappa {
    float: right;
    font-size: 13px;
    color: var(--accent-strong);
    text-decoration: none;
    font-weight: 500;
}
.link-mappa:hover { text-decoration: underline; }

.modale {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.modale[hidden] { display: none; }
.modale-backdrop {
    position: absolute; inset: 0;
    background: rgba(4, 12, 18, 0.72);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modale-box {
    position: relative; z-index: 1;
    max-width: 92vw; max-height: 88vh;
    background: var(--glass-bg);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modale-box img {
    display: block;
    max-width: 100%; max-height: calc(88vh - 28px);
    border-radius: var(--radius-sm);
}
.modale-x {
    position: absolute; top: -14px; right: -14px;
    width: 38px; height: 38px;
    border-radius: 50%; border: 1px solid var(--field-border);
    background: var(--bg-2); color: var(--text);
    font-size: 22px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.modale-x:hover { border-color: var(--accent-strong); color: var(--accent-strong); }

input[type="text"], input[type="email"], input[type="tel"],
input[type="date"], select {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text);
    background: var(--field-bg);
    border: 1px solid var(--field-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: var(--text-faint); }
input:focus, select:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: rgba(255, 255, 255, 0.10);
}
select option { color: #0f172a; }
input[type="date"] { color-scheme: dark; }

/* Honeypot nascosto */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Griglia letti */
.letti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.letto {
    border: 1px solid var(--field-border);
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 12px 6px;
    text-align: center;
    cursor: pointer;
    transition: transform .12s, border-color .15s, background .15s;
    user-select: none;
}
.letto:hover { transform: translateY(-2px); }
.letto .ico { font-size: 20px; display: block; margin-bottom: 4px; }
.letto .nome { font-size: 13px; font-weight: 500; }
.letto .stato { font-size: 11px; }
.letto.libero { }
.letto.libero .stato { color: var(--ok); }
.letto.occupato {
    cursor: not-allowed;
    opacity: 0.55;
    background: var(--ko-bg);
    border-color: rgba(248, 113, 113, 0.4);
}
.letto.occupato .stato { color: var(--ko); }
.letto.selected {
    background: var(--accent-soft);
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 2px var(--accent-soft);
}
.letto.selected .nome,
.letto.selected .ico { color: var(--accent-strong); }
.hint { color: var(--text-faint); font-size: 13px; grid-column: 1 / -1; margin: 4px 0; }

/* Dropzone */
.dropzone {
    display: block;
    border: 1.5px dashed var(--field-border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent-strong); background: rgba(255,255,255,0.05); }
.dropzone.filled { border-color: var(--ok); color: var(--ok); }
.dz-icon { display: block; font-size: 22px; margin-bottom: 6px; }

/* Captcha */
.captcha-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.captcha-row img {
    border-radius: var(--radius-sm);
    border: 1px solid var(--field-border);
    background: #f1efe8;
    display: block;
}
.captcha-row input { flex: 1; min-width: 160px; }
.icon-btn {
    background: var(--field-bg);
    border: 1px solid var(--field-border);
    color: var(--text);
    border-radius: var(--radius-sm);
    width: 44px; height: 44px;
    font-size: 18px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.icon-btn:hover { border-color: var(--accent-strong); background: rgba(255,255,255,0.10); }

/* Messaggi */
.msg {
    display: none;
    margin: 4px 0 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.msg.show { display: block; }
.msg.ok  { background: var(--ok-bg); color: var(--ok); border: 1px solid rgba(52,211,153,0.4); }
.msg.ko  { background: var(--ko-bg); color: var(--ko); border: 1px solid rgba(248,113,113,0.4); }

/* Pulsanti */
.actions { margin-top: 8px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.btn-primary, .btn-ghost, .btn-danger {
    appearance: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 13px 24px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    display: inline-block;
    transition: transform .12s, filter .15s, opacity .15s;
}
.btn-primary {
    color: #04313a;
    background: linear-gradient(135deg, #67e8f9, var(--accent));
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .55; cursor: progress; transform: none; }
.btn-ghost {
    color: var(--text);
    background: var(--field-bg);
    border: 1px solid var(--field-border);
}
.btn-ghost:hover { border-color: var(--accent-strong); }
.btn-danger { color: #fff; background: linear-gradient(135deg, #fb7185, #e11d48); }
.btn-danger:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* Esito (verifica / prenotazione) */
.esito { padding: 40px 28px; }
.esito-badge {
    width: 64px; height: 64px; line-height: 64px;
    border-radius: 50%; margin: 0 auto 16px;
    font-size: 30px; font-weight: 700;
}
.esito-ok .esito-badge { background: var(--ok-bg); color: var(--ok); }
.esito-ko .esito-badge { background: var(--ko-bg); color: var(--ko); }
.esito p { color: var(--text-dim); margin: 0 0 22px; }
.esito .btn-primary, .esito .btn-ghost { margin-top: 6px; }

/* Dettaglio prenotazione */
.stato-riga { margin: 6px 0 18px; }
.stato-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}
.stato-ok     { background: var(--ok-bg);   color: var(--ok); }
.stato-ko     { background: var(--ko-bg);   color: var(--ko); }
.stato-attesa { background: var(--warn-bg); color: var(--warn); }
.stato-neutro { background: rgba(255,255,255,0.08); color: var(--text-dim); }

.dettaglio { margin: 0 0 18px; }
.dettaglio > div {
    display: flex; justify-content: space-between; gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dettaglio dt { color: var(--text-dim); font-size: 13px; margin: 0; }
.dettaglio dd { margin: 0; text-align: right; font-weight: 500; font-size: 14px; }

.foot { text-align: center; color: var(--text-faint); font-size: 12px; margin-top: 26px; }

/* Anteprima documento allegato */
.doc-box { margin: 6px 0 18px; }
.doc-img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--field-border);
    display: block;
}

/* Pannello di esito dentro la card (sostituisce il form al successo) */
.esito-inline { text-align: center; padding: 12px 4px 4px; }
.esito-inline h2 { margin: 0 0 10px; font-size: 20px; font-weight: 600; }
.esito-inline .esito-badge {
    width: 64px; height: 64px; line-height: 64px;
    border-radius: 50%; margin: 0 auto 14px;
    font-size: 30px; font-weight: 700;
    background: var(--ok-bg); color: var(--ok);
}
.esito-inline.esito-annullata .esito-badge { background: var(--warn-bg); color: var(--warn); }
.esito-inline p { color: var(--text-dim); font-size: 15px; line-height: 1.6; margin: 0 auto 22px; max-width: 480px; }
.esito-inline p strong { color: var(--text); }
.esito-inline .nota { color: var(--text-faint); font-size: 13px; }
.esito-inline .nota-ko { color: var(--ko); font-size: 14px; }
.actions-center { justify-content: center; }

@media (max-width: 520px) {
    h1 { font-size: 23px; }
    .card { padding: 20px; }
    .actions { justify-content: stretch; }
    .btn-primary, .btn-danger { width: 100%; text-align: center; }
}
