/* ===================================
   CUBO REAL ESTATE ADVISORY
   Design Minimalista v4.0
   
   Palette: #2e2316 (seppia) + #faf8f3 (carta)
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 18px;
    line-height: 1.7;
    color: #2e2316;
    background: #faf8f3;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.2;
}

h2 {
    font-size: 2.5rem;
    line-height: 1.3;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* HEADER */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(250, 248, 243, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(46, 35, 22, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo img {
    height: 60px;
    width: auto;
    display: block;
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav a {
    color: #2e2316;
    text-decoration: none;
    font-size: 0.95rem;
    transition: opacity 0.3s ease;
}

nav a:hover {
    opacity: 0.6;
}

/* SEZIONI */
section {
    min-height: 100vh;
    padding: 8rem 2rem;
    position: relative;
}

section:first-of-type {
    margin-top: 0;
}

.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 12rem;
}

.hero h1 {
    margin-bottom: 1rem;
    font-weight: 400;
}

.hero .tagline {
    font-size: 1.3rem;
    color: rgba(46, 35, 22, 0.7);
    max-width: 600px;
    margin-bottom: 3rem;
}

/* SEZIONI ALTERNATE */
.section-dark {
    background: #2e2316;
    color: #faf8f3;
}

.section-dark h2,
.section-dark h3,
.section-dark p,
.section-dark a {
    color: #faf8f3;
}

/* LOGO LINK (home) */
.header-logo a {
    display: block;
    line-height: 0;
}

.header-logo a:hover img {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

/* FILIGRANA LOGO */
.with-watermark {
    position: relative;
}

/* Sezioni CHIARE: filigrana scura (colore brand) */
.with-watermark::before {
    content: '';
    position: absolute;
    right: 3%;
    top: 50%;
    transform: translateY(-50%);
    width: 40%;          /* Dimensione relativa alla sezione */
    max-width: 420px;    /* Cap per schermi grandi */
    min-width: 200px;    /* Minimo leggibile */
    aspect-ratio: 1 / 1;
    background-image: url('../assets/logo.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.08;       /* Scuro su chiaro: discreto ma visibile */
    pointer-events: none;
    z-index: 1;
}

/* Sezioni SCURE: filigrana chiara (inversa) */
.section-dark.with-watermark::before {
    filter: invert(1) brightness(3);
    opacity: 0.10;       /* Chiaro su scuro: leggermente più visibile */
}

.with-watermark > .container {
    position: relative;
    z-index: 2;
}

/* SERVIZI */
.services-list {
    max-width: 800px;
    margin: 0 auto;
}

.service-item {
    border-bottom: 1px solid rgba(46, 35, 22, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.section-dark .service-item {
    border-bottom-color: rgba(250, 248, 243, 0.15);
}

.service-header {
    padding: 2rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.service-header:hover {
    opacity: 0.7;
}

.service-title {
    font-size: 1.3rem;
    font-weight: 400;
}

.service-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.service-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.service-content-inner {
    padding: 0 0 2rem 0;
}

.service-item.active .service-content {
    max-height: 800px;
}

.service-item.active .service-icon {
    transform: rotate(45deg);
}

/* GRID PRINCIPI */
.principles-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

.principle {
    text-align: center;
    flex: 1 1 220px;
    max-width: 320px;
}

.principle h3 {
    margin-bottom: 1rem;
}

/* CONTATTI */
.contact-form {
    max-width: 600px;
    margin: 3rem auto 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

input,
textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid rgba(46, 35, 22, 0.2);
    background: transparent;
    color: #2e2316;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.section-dark input,
.section-dark textarea {
    border-color: rgba(250, 248, 243, 0.2);
    color: #faf8f3;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #2e2316;
}

.section-dark input:focus,
.section-dark textarea:focus {
    border-color: #faf8f3;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

button[type="submit"] {
    background: #2e2316;
    color: #faf8f3;
    border: none;
    padding: 1rem 3rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.section-dark button[type="submit"] {
    background: #faf8f3;
    color: #2e2316;
}

button[type="submit"]:hover {
    opacity: 0.8;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 0.3rem;
}

.checkbox-group label {
    margin-bottom: 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* FOOTER */
footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid rgba(46, 35, 22, 0.1);
    font-size: 0.9rem;
}

.section-dark footer {
    border-top-color: rgba(250, 248, 243, 0.1);
}

footer a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

footer a:hover {
    opacity: 0.6;
}

/* HAMBURGER MENU */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    z-index: 1001;
    position: relative;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 1.5px;
    background-color: #2e2316;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

/* Animazione hamburger -> X */
.hamburger.is-open .hamburger-line:nth-child(1) {
    transform: translateY(8.25px) rotate(45deg);
}
.hamburger.is-open .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.is-open .hamburger-line:nth-child(3) {
    transform: translateY(-8.25px) rotate(-45deg);
}

/* Overlay scuro dietro il pannello mobile */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(46, 35, 22, 0.25);
    z-index: 998;
    cursor: pointer;
}
.nav-overlay.is-open {
    display: block;
}

/* Select nel form contatti */
select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid rgba(46, 35, 22, 0.2);
    background: transparent;
    color: #2e2316;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
select:focus {
    outline: none;
    border-color: #2e2316;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .header-logo img {
        height: 50px;
    }

    /* Mostra hamburger */
    .hamburger {
        display: flex;
    }

    /* Il nav diventa pannello slide-in da destra */
    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 300px;
        height: 100vh;
        background: #faf8f3;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 2rem;
        padding: 2rem 2.5rem;
        z-index: 999;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -4px 0 24px rgba(46, 35, 22, 0.12);
        border-left: 1px solid rgba(46, 35, 22, 0.08);
    }

    nav ul.is-open {
        right: 0;
    }

    nav a {
        font-size: 1.1rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    section {
        padding: 6rem 1.5rem;
    }

    .with-watermark::before {
        width: 55%;
        min-width: 150px;
        opacity: 0.06;
    }

    .principles-grid {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .principle {
        max-width: 100%;
        width: 100%;
    }
}

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

section {
    animation: fadeIn 0.6s ease;
}
