/* ==========================================================================
   Service ADSL — foglio di stile condiviso
   Caricato da tutte le pagine del sito e dal pannello di controllo.
   Tailwind (CDN) copre le utility: qui stanno solo i componenti ricorrenti.
   ========================================================================== */

:root {
    --header-h: 72px;
    --blu-scuro: #1E3A8A;   /* blue-900 */
    --blu: #3B82F6;         /* blue-500 */
    --blu-chiaro: #60A5FA;  /* blue-400 */
}

body {
    font-family: 'Roboto', sans-serif;
    /* L'header è fisso: lo spazio glielo riserviamo qui una volta per tutte. */
    padding-top: var(--header-h);
}

/* --- Hero ---------------------------------------------------------------- */

.hero-bg {
    background-image: url('../img/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}
.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 1;
}
.hero-bg > * {
    position: relative;
    z-index: 2;
}

/* --- Navigazione --------------------------------------------------------- */

.site-header {
    /* Altezza nominale: logo h-12 (48px) + py-3 (24px). Il menu mobile,
       quando aperto, si estende sotto senza spostare il contenuto. */
    min-height: var(--header-h);
}

.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--blu-chiaro);
    transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
    width: 100%;
}

/* --- Card ---------------------------------------------------------------- */

.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* --- Etichette ----------------------------------------------------------- */

.badge {
    display: inline-block;
    background-color: #DBEAFE;
    color: #1E40AF;
    border-radius: 9999px;
    padding: 2px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tech-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 6px;
    padding: 3px 10px;
}
.tech-fttc { background-color: #FEF9C3; color: #854D0E; }
.tech-ftth { background-color: #DCFCE7; color: #166534; }
.tech-fwa  { background-color: #DBEAFE; color: #1E40AF; }

/* --- Animazioni ---------------------------------------------------------- */

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Pagina "Chi siamo" -------------------------------------------------- */

.timeline-line {
    border-left: 3px solid var(--blu);
}

/* ==========================================================================
   Form — usati dalla richiesta di attivazione e dal pannello
   ========================================================================== */

.field-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.35rem;
}
.field-label .opt {
    font-weight: 400;
    color: #9CA3AF;
    text-transform: none;
}

.field-input {
    width: 100%;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    color: #111827;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field-input::placeholder { color: #9CA3AF; }
.field-input:focus {
    outline: none;
    border-color: var(--blu);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.field-input[aria-invalid="true"] {
    border-color: #DC2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.field-error {
    display: none;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #DC2626;
}
.field-error.is-visible { display: block; }

/* Scelta del profilo: la label è tutta cliccabile, il radio resta accessibile
   ma fuori dallo schermo. */
.profilo-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.profilo-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 2px solid #E5E7EB;
    border-radius: 0.75rem;
    background-color: #fff;
    padding: 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.profilo-card:hover {
    border-color: var(--blu-chiaro);
    transform: translateY(-2px);
}
.profilo-option input:focus-visible + .profilo-card {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
}
.profilo-option input:checked + .profilo-card {
    border-color: var(--blu);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.2);
}
.profilo-card .check {
    display: none;
}
.profilo-option input:checked + .profilo-card .check {
    display: inline-flex;
}

/* Scelta con/senza attivazione dentro la card del profilo: stesso pattern,
   annidato, per obbligare il cliente a distinguere le due condizioni. */
.soluzione-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.soluzione-card {
    display: block;
    border: 2px solid #BFDBFE;
    border-radius: 0.65rem;
    background-color: #EFF6FF;
    padding: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.soluzione-option input:focus-visible + .soluzione-card {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
}
.soluzione-option input:checked + .soluzione-card {
    border-color: var(--blu);
    background-color: #DBEAFE;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* --- Passi del modulo ---------------------------------------------------- */

.step[hidden] { display: none; }

.step-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #9CA3AF;
}
.step-nav .step-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 9999px;
    background-color: #E5E7EB;
    color: #6B7280;
}
.step-nav[data-state="active"] { color: var(--blu-scuro); }
.step-nav[data-state="active"] .step-dot { background-color: var(--blu); color: #fff; }
.step-nav[data-state="done"] { color: #059669; }
.step-nav[data-state="done"] .step-dot { background-color: #059669; color: #fff; }

/* --- Pulsanti ------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    padding: 0.7rem 1.75rem;
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background-color: var(--blu); color: #fff; }
.btn-primary:hover:not(:disabled) { background-color: #2563EB; transform: translateY(-1px); }
.btn-ghost { background-color: #fff; color: var(--blu-scuro); border: 1px solid #D1D5DB; }
.btn-ghost:hover { background-color: #F3F4F6; }

/* ==========================================================================
   Pannello di controllo
   ========================================================================== */

.admin body,
body.admin {
    padding-top: 0;
    background-color: #F3F4F6;
}

.stato-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    padding: 0.15rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}
.stato-nuova       { background-color: #DBEAFE; color: #1E40AF; }
.stato-in_lavorazione { background-color: #FEF3C7; color: #92400E; }
.stato-attivata    { background-color: #DCFCE7; color: #166534; }
.stato-chiusa      { background-color: #E5E7EB; color: #4B5563; }

.admin-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    font-weight: 700;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #E5E7EB;
}
.admin-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: top;
}
.admin-table tbody tr:hover { background-color: #F9FAFB; }
