/* ===============================
   RESET E IMPOSTAZIONI GLOBALI
   =============================== */
body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    /* Evita lo scroll nella home con SVG */
}

/* ===============================
   TOPBAR
   =============================== */
#topbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #1a1e29;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    border-bottom: 1px solid #333;
    z-index: 10;
}

#topbar a {
    text-decoration: none;
    color: inherit;
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    transition: text-shadow 0.3s;
}

.logo:hover {
    text-shadow: 0 0 20px rgba(255, 255, 255, 1);
}

/* ===============================
   CONTENITORE PRINCIPALE
   =============================== */
#main-content {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 60px);
    overflow-y: auto;
    /* Permette lo scroll se il contenuto (es. form) eccede */
}

/* ===============================
   MAPPA SVG A TRE SETTORI
   =============================== */
svg {
    width: 100%;
    height: 100%;
    /* In main-content si adatta all'altezza residua */
    display: block;
}

.area {
    cursor: pointer;
}

.area polygon {
    fill: #000000;
    stroke: #ffffff;
    vector-effect: non-scaling-stroke;
    stroke-width: 2;
    transition: fill 0.3s ease;
}

.area:hover polygon {
    fill: #111111;
}

.label {
    fill: #ffffff;
    font-size: 80px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: middle;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
    pointer-events: none;
    transition: filter 0.3s ease;
}

.area:hover .label {
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 1));
}

/* ===============================
   FORM CONTATTI
   =============================== */
.contact-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

form {
    /* Rimosso background, padding e box-shadow per evitare conflitti con .modal-content */
    width: 100%;
}

form h2 {
    margin-top: 0;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #aaa;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    background: #000;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    font-family: inherit;
    transition: border-color 0.3s;
    /* <-- Qui c'era l'errore! */
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    background: #fff;
    color: #000;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.btn-submit:hover {
    background: #ccc;
}

/* ===============================
   LAYER MODALE CONTATTI
   =============================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    /* Sfondo scuro semitrasparente */
    backdrop-filter: blur(4px);
    /* Leggera sfocatura dello sfondo SVG */
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #11141c;
    padding: 40px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    border: 1px solid #333;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    position: relative;
    box-sizing: border-box;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #888;
    transition: color 0.3s;
    line-height: 1;
}

.close-btn:hover {
    color: #fff;
}