:root {
    --colore-principale: #5e7153;
    --colore-secondario: #8c9c83;
    --colore-testo: #2d3436;
    --colore-box-semi: rgba(255, 255, 255, 0.97);
    --colore-bordi: #d8e0d5;
    --verde-ok: #27ae60;
    --raggio: 10px;
    --ombra: 0 20px 50px rgba(0,0,0,0.22);
}

/* =========================================
   BASE & SFONDO
   ========================================= */
body {
    font-family: 'Arial', sans-serif;
    background-image: url('assets/Foto sfondo.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-color: #e8ede6;
    padding: 40px 20px;
    color: var(--colore-testo);
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
    transition: background-image 1s ease-in-out;
    animation: fadeIn 1.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   CONTAINER PRINCIPALE
   ========================================= */
.container {
    max-width: 820px;
    margin: 0 auto;
    background: var(--colore-box-semi);
    border-radius: 16px;
    box-shadow: var(--ombra);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.4);
    position: relative;
}

/* =========================================
   MULTILINGUA
   ========================================= */
.en { display: none; }
body.lang-en .it { display: none !important; }
body.lang-en .en { display: inline !important; }

/* =========================================
   PULSANTI LINGUA
   ========================================= */
.lang-switch {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 20;
    display: flex;
    gap: 8px;
}
.lang-switch button {
    background: rgba(255,255,255,0.92);
    border: 1.5px solid rgba(255,255,255,0.6);
    padding: 7px 13px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    color: #444;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    width: auto;
    margin: 0;
    text-transform: none;
    transition: background 0.2s, color 0.2s;
    backdrop-filter: blur(4px);
}
.lang-switch button.active {
    background: var(--colore-principale);
    color: white;
    border-color: var(--colore-principale);
}

/* =========================================
   HEADER CON FOTO
   ========================================= */
.header-img {
    background-image: url('assets/Foto copertina.jpg');
    background-size: cover;
    background-position: center;
    height: 260px;
    width: 100%;
    position: relative;
}
.header-img::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.55) 100%);
}
.header-content {
    position: absolute;
    bottom: 24px;
    left: 32px;
    z-index: 10;
    color: white;
}

h1 {
    margin: 0;
    font-size: 30px;
    font-family: 'Georgia', serif;
    text-shadow: 1px 2px 6px rgba(0,0,0,0.5);
    letter-spacing: 0.3px;
}

/* =========================================
   TESTO INTRODUTTIVO
   ========================================= */
.intro-text {
    padding: 18px 32px;
    text-align: center;
    color: #666;
    background: #f7faf7;
    border-bottom: 1px solid #eaf0e8;
    font-size: 14px;
    line-height: 1.7;
}

/* =========================================
   TITOLI SEZIONE
   ========================================= */
h2 {
    color: var(--colore-principale);
    margin-top: 0;
    margin-bottom: 18px;
    border-bottom: 2px solid #eaf0e8;
    padding-bottom: 10px;
    font-weight: normal;
    font-family: 'Georgia', serif;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================================
   SEZIONI FORM
   ========================================= */
.section {
    padding: 24px 36px 30px 36px;
    border-bottom: 1px solid #eaf0e8;
}
.section:last-child { border-bottom: none; }

/* =========================================
   LABEL
   ========================================= */
label {
    display: block;
    margin-top: 16px;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* =========================================
   INPUT, SELECT
   ========================================= */
input, select {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--colore-bordi);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 15px;
    background-color: #fff;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--colore-testo);
}
input:focus, select:focus {
    outline: none;
    border-color: var(--colore-principale);
    box-shadow: 0 0 0 3px rgba(94,113,83,0.12);
}

input[type="file"] {
    padding: 12px;
    font-size: 14px;
    background-color: #f7faf7;
    border: 1.5px dashed var(--colore-principale);
    cursor: pointer;
    border-radius: 8px;
    color: #666;
}

/* =========================================
   GRID 2 COLONNE
   ========================================= */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* =========================================
   BOX FOTO DOCUMENTO
   ========================================= */
.box-foto-doc {
    background: rgba(94,113,83,0.07);
    padding: 18px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1.5px dashed var(--colore-principale);
}
.box-foto-doc > label {
    color: var(--colore-principale);
    font-size: 14px;
    margin-top: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: bold;
}

/* =========================================
   OSPITE EXTRA
   ========================================= */
.extra-guest {
    background-color: rgba(94,113,83,0.05);
    padding: 20px;
    border-left: 4px solid var(--colore-secondario);
    margin-top: 20px;
    border-radius: 8px;
}

/* =========================================
   BOTTONE INVIO
   ========================================= */
button[type="button"]#btnInvia, button {
    background: linear-gradient(135deg, var(--colore-principale), #4a5e40);
    color: white;
    border: none;
    padding: 17px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 9px;
    width: 100%;
    margin-top: 25px;
    box-shadow: 0 4px 15px rgba(94,113,83,0.35);
    transition: opacity 0.2s, transform 0.15s;
}
button:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
}
button[type="button"]#btnInvia:disabled, button:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

#ospitiAggiuntiviContainer { margin-bottom: 20px; }

/* =========================================
   MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 600px) {
    body { padding: 10px; }
    .grid { grid-template-columns: 1fr; gap: 6px; }
    .section { padding: 18px 18px 22px 18px; }
    .header-img { height: 180px; }
    .header-content { left: 18px; bottom: 16px; }
    h1 { font-size: 22px; }
    h2 { font-size: 17px; }
    .intro-text { font-size: 13px; padding: 14px 18px; }
    .lang-switch { top: 10px; right: 10px; }
    .lang-switch button { padding: 6px 10px; font-size: 12px; }
}

/* =========================================
   WARNING DOC / ANIMAZIONE
   ========================================= */
@keyframes pulseWarning {
    0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}
.warning-doc {
    background: #fff8e1;
    border: 1px solid #ffeeba;
    border-left: 5px solid #ffc107;
    padding: 12px 15px;
    margin: 12px 0;
    border-radius: 6px;
    font-size: 13.5px;
    color: #856404;
    animation: pulseWarning 2s infinite;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.5;
}
.warning-doc .icon-animation {
    font-size: 26px;
    animation: flipBook 3s infinite ease-in-out;
    display: inline-block;
}
@keyframes flipBook {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
    100% { transform: rotateY(0deg); }
}
