html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    background: #f5f1e9;
    color: #3a2c23;
    font-size: 18px; /* testo base più grande */
    line-height: 1.7;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* HEADER */

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #3a2c23;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* NAV DESKTOP */

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.main-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem; /* più grande */
    position: relative;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 2px;
    background: #f1d3a3;
    transition: width 0.25s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

/* HAMBURGER (MOBILE) */

.menu-toggle {
    display: none; /* mostrato solo su mobile */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    margin: 4px 0;
    background: #fff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Stato aperto hamburger */

.menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* LAYOUT GENERALE */

.site-main {
    flex: 1; /* fa sì che il footer stia in fondo */
    padding: 30px;
}

.section {
    margin-bottom: 50px;
}

.section h2 {
    font-size: 2.2rem; /* più grande */
    margin-bottom: 18px;
}

/* HERO + SLIDER */

.hero {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
    align-items: center;
}

.hero-text {
    flex: 1 1 320px;
}

.hero-text h1 {
    font-size: 2.9rem; /* titolo principale più grande */
    margin-bottom: 18px;
}

.hero-text p {
    line-height: 1.7;
    margin-bottom: 14px;
    font-size: 1.05rem;
}

.hero-buttons {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* SPAZIO FOTO SLIDER */

.hero-slider {
    flex: 0 1 320px;
    max-width: 360px;
    position: relative;
    min-height: 190px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
    margin-left: auto;
}

.hero-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slider-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.45), transparent 60%);
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    padding: 10px;
}

.slider-badge {
    background: rgba(255,255,255,0.9);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* CARDS & FORM */

.card {
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.card-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
}

.card-columns h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 1.1rem; /* più grande */
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #cbb7a5;
    background: #fbf7f1;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 90px;
    resize: vertical;
}

/* BUTTONS */

.button {
    display: inline-block;
    padding: 11px 22px;
    border-radius: 999px;
    border: none;
    background: #8b5e3b;
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem; /* più grande */
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:hover {
    background: #6b462a;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.button-outline {
    background: transparent;
    color: #8b5e3b;
    border: 1px solid #8b5e3b;
}

.button-outline:hover {
    background: #8b5e3b;
    color: #fff;
}

/* FOOTER */

.site-footer {
    text-align: center;
    padding: 16px;
    background: #3a2c23;
    color: #fff;
    font-size: 0.95rem;
    margin-top: auto; /* sticky footer */
}

/* ADMIN TABLE */

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 1rem; /* un po' più grande */
}

.table th, .table td {
    border: 1px solid #e0d6c8;
    padding: 9px;
}

.badge {
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.badge.pending { background: #fce7b2; }
.badge.accepted { background: #c5f3c1; }
.badge.rejected { background: #f6b7b7; }

/* ANIMAZIONI GLOBALI */

.animate-section {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.animate-section.in-view {
    opacity: 1;
    transform: translateY(0);
}

.title-animated {
    animation: floatTitle 3s ease-in-out infinite alternate;
}

.form-animated {
    animation: fadeInScale 0.7s ease-out;
}

.fade-in {
    animation: fadeInScale 0.9s ease-out;
}

/* KEYFRAMES */

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(1.03);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes floatTitle {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-6px);
    }
}

/* ====== AUTH (LOGIN / REGISTRAZIONE) ====== */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 150px); /* header + footer */
}

.auth-container {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.auth-title {
    margin-bottom: 18px;
    font-size: 2rem;
}

.auth-switch {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin: 0 auto 22px;
    background: #f0e0cf;
    border-radius: 999px;
    padding: 4px;
    max-width: 340px;
}

.auth-switch-option {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
    padding: 5px 0;
}

.auth-switch-option input {
    display: none;
}

.auth-switch-option span {
    display: inline-block;
    font-size: 1.05rem;
    color: #5a3b27;
}

.auth-slider-bar {
    position: absolute;
    inset: 4px;
    border-radius: 999px;
    overflow: hidden;
    pointer-events: none;
}

.auth-slider-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    transition: transform 0.25s ease;
}

/* sposta il thumb a destra quando siamo in modalità registrazione */
.auth-switch[data-auth-mode="register"] .auth-slider-thumb {
    transform: translateX(100%);
}

.auth-panel {
    display: none;
    text-align: left;
}

.auth-panel.active {
    display: block;
}

.auth-form {
    margin-top: 12px;
}

.auth-message {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.auth-message.error {
    color: #b33939;
}

.auth-message.success {
    color: #2e8b57;
}

.forgot-password-link {
    margin-top: 10px;
    font-size: 0.95rem;
}

/* ====== CONTATTI ====== */

.contact-card {
    max-width: 550px;
    margin: 0 auto;
}

.contact-item {
    margin: 18px 0;
}

.contact-label {
    font-weight: bold;
    margin-right: 5px;
    font-size: 1.05rem;
}

.contact-link {
    color: #8b5e3b;
    text-decoration: underline;
    font-size: 1.05rem;
}

.contact-phone-button {
    display: inline-block;
    background: #8b5e3b;
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.05rem;
}

.contact-phone-button:hover {
    background: #6b462a;
}

/* MENU A COMPARSA PER TELEFONO */

.phone-options {
    display: none;
    flex-direction: column;
    margin-top: 8px;
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    max-width: 200px;
}

.phone-options a {
    padding: 6px 8px;
    text-decoration: none;
    color: #3a2c23;
    border-radius: 5px;
    font-size: 1rem;
}

.phone-options a:hover {
    background: #f0e0cf;
}

/* RESPONSIVE - MOBILE */

@media (max-width: 768px) {
    .site-header {
        padding: 10px 14px;
    }

    .logo {
        font-size: 1.3rem;
    }

    /* Mostra hamburger, nascondi menu inizialmente */
    .menu-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: #3a2c23;
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 14px 14px;
        gap: 10px;
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .main-nav a {
        padding: 4px 0;
        font-size: 1.05rem;
    }

    /* Menu aperto */
    .main-nav.open {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .site-main {
        padding: 16px;
    }

    .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }

    .hero-slider {
        align-self: stretch;
        max-width: 100%;
        min-height: 170px;
        margin-left: 0;
    }

    .hero-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .section h2 {
        font-size: 1.9rem;
    }

    .card {
        padding: 18px;
    }

    .auth-page {
        min-height: calc(100vh - 120px);
    }

    .auth-container {
        padding: 10px;
    }
}
