/* ============================================================================
 * public_design.css — Design system per l'area pubblica di OrientaOnline.
 * Mantiene il pattern "bg cielo + box scuro" come identità visiva.
 * ============================================================================ */

:root {
    --pub-primary: #3b82f6;
    --pub-primary-hover: #2563eb;
    --pub-success: #22c55e;
    --pub-success-hover: #16a34a;
    --pub-danger: #ef4444;
    --pub-accent: #fbbf24;
    --pub-overlay: rgba(0, 0, 0, 0.55);
    --pub-overlay-strong: rgba(0, 0, 0, 0.75);
    --pub-text: #ffffff;
    --pub-text-muted: rgba(255, 255, 255, 0.78);
    --pub-border: rgba(255, 255, 255, 0.22);
    --pub-field-bg: rgba(255, 255, 255, 0.96);
    --pub-field-text: #1f2937;
    --pub-radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background: url('../img/convenzione_bg.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--pub-text);
    font-size: 15px;
    line-height: 1.5;
}

/* ----- Layout centrato (login, register, profilo, ecc.) ----- */
.pub-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 2rem);
}

.pub-box {
    background: var(--pub-overlay);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--pub-border);
    border-radius: var(--pub-radius);
    padding: clamp(1.5rem, 4vw, 2.25rem);
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.pub-box.wide { max-width: 720px; }
.pub-box.medium { max-width: 560px; }

.pub-box h1,
.pub-box h2 {
    margin: 0 0 1.25rem;
    font-weight: 600;
    text-align: center;
}
.pub-box h1 { font-size: 1.45rem; }
.pub-box h2 { font-size: 1.2rem; }
.pub-box h3 { font-size: 1rem; margin: 0 0 0.5rem; }

/* ----- Form ----- */
.form-group { margin-bottom: 0.9rem; }
.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--pub-text-muted);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
@media (max-width: 480px) {
    .form-row { grid-template-columns: 1fr; }
}

.pub-box input[type="text"],
.pub-box input[type="email"],
.pub-box input[type="password"],
.pub-box input[type="tel"],
.pub-box input[type="number"],
.pub-box input[type="url"],
.pub-box select,
.pub-box textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--pub-field-bg);
    color: var(--pub-field-text);
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.5;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.pub-box input:focus,
.pub-box select:focus,
.pub-box textarea:focus {
    outline: none;
    border-color: var(--pub-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
}
.pub-box textarea { min-height: 80px; resize: vertical; }

.pub-box input[type="checkbox"],
.pub-box input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    vertical-align: middle;
    accent-color: var(--pub-primary);
    margin-right: 0.4rem;
}

/* ----- Bottoni ----- */
.btn-pub {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--pub-primary);
    color: white;
    border: 1px solid var(--pub-primary);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
    transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn-pub:hover { background: var(--pub-primary-hover); border-color: var(--pub-primary-hover); }
.btn-pub:active { transform: translateY(1px); }

.btn-pub.success { background: var(--pub-success); border-color: var(--pub-success); }
.btn-pub.success:hover { background: var(--pub-success-hover); border-color: var(--pub-success-hover); }

.btn-pub.ghost {
    background: transparent;
    color: var(--pub-text);
    border-color: var(--pub-border);
}
.btn-pub.ghost:hover { background: rgba(255,255,255,0.12); }

.btn-pub.auto { width: auto; padding: 0.5rem 1.25rem; }

/* ----- Links / footer del box ----- */
.pub-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.pub-links a {
    color: var(--pub-accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}
.pub-links a:hover { text-decoration: underline; }
.pub-links.between { justify-content: space-between; }

/* ----- Messages (info/success/warning/error) ----- */
.pub-message {
    padding: 0.85rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.12);
    border-left: 3px solid var(--pub-primary);
    font-size: 0.9rem;
}
.pub-message.success { background: rgba(34, 197, 94, 0.20); border-left-color: var(--pub-success); }
.pub-message.warning { background: rgba(251, 191, 36, 0.20); border-left-color: var(--pub-accent); }
.pub-message.error   { background: rgba(239, 68, 68, 0.20);  border-left-color: var(--pub-danger); }

/* ----- Detail list (profilo / dashboard utente) ----- */
.pub-detail-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 1rem;
    margin: 1rem 0;
}
.pub-detail-list dt {
    color: var(--pub-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}
.pub-detail-list dd {
    margin: 0;
    color: var(--pub-text);
    word-break: break-word;
}

/* ----- Alloggi (pagina convenzioni) ----- */
.alloggio-card {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid var(--pub-border);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}
.alloggio-card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.alloggio-card p  { margin: 0.25rem 0; font-size: 0.9rem; }
.alloggio-card a  { color: var(--pub-accent); text-decoration: none; }
.alloggio-card a:hover { text-decoration: underline; }

/* ----- Top nav semplice (landing) ----- */
.top-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--pub-overlay-strong);
    border-bottom: 1px solid var(--pub-border);
}
.top-nav a {
    padding: 0.45rem 1rem;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid var(--pub-border);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s;
}
.top-nav a:hover { background: rgba(255, 255, 255, 0.22); }

/* ----- Landing content ----- */
.pub-hero {
    text-align: center;
    padding: 2.5rem 1.5rem;
}
.pub-hero h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin: 0 0 1rem;
    font-weight: 700;
}
.pub-hero p { font-size: 1.05rem; }

/* ----- Mappa fullscreen (alloggi.php) ----- */
.map-page { margin: 0; height: 100vh; overflow: hidden; }
.map-page body { background: none; }
#map { width: 100%; height: 100vh; }

.map-overlay {
    position: absolute;
    background: white;
    color: var(--pub-field-text);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    z-index: 1000;
}
.map-filter {
    top: 1rem; right: 1rem;
    padding: 1rem;
    max-width: 280px;
}
.map-filter label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
}
.map-filter select {
    width: 100%;
    padding: 0.3rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    background: white;
    color: #1f2937;
}
.map-filter select:focus {
    outline: none;
    border-color: var(--pub-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.map-filter .map-link {
    display: block;
    margin-top: 0.65rem;
    font-size: 0.85rem;
    color: var(--pub-primary);
    text-decoration: none;
}
.map-filter .map-link:hover { text-decoration: underline; }

.map-admin {
    bottom: 1rem; right: 1rem;
    padding: 0.55rem 1rem;
}
.map-admin a {
    color: var(--pub-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

/* ----- Pagina documentazione (istruzioni.php): tema chiaro ----- */
.doc-body {
    background: #f5f7fa;
    color: var(--pub-field-text);
    min-height: 100vh;
}
.doc-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}
.doc-container h1 {
    color: var(--pub-primary);
    margin: 0 0 1.5rem;
    font-size: 1.625rem;
    font-weight: 600;
}
.doc-step {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
}
.doc-step h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
}
.doc-step img {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 0.75rem;
    border: 1px solid #e5e7eb;
}
.doc-note {
    background: #fef9c3;
    border-left: 3px solid #ca8a04;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    color: #1f2937;
}
.doc-note code {
    background: rgba(0,0,0,0.06);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.doc-back {
    display: inline-block;
    margin-top: 1rem;
    color: var(--pub-primary);
    text-decoration: none;
    font-weight: 500;
}
.doc-back:hover { text-decoration: underline; }

/* ----- Utility ----- */
.text-center { text-align: center; }
.text-muted  { color: var(--pub-text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
