/* ==========================================================================
   Studio Legale Ferrara - Stile principale
   ========================================================================== */

:root {
    --primary: #1a2332;
    --primary-light: #2a3a4f;
    --accent: #c8a472;
    --accent-dark: #b08a5a;
    --text: #333333;
    --text-light: #666666;
    --bg-light: #f8f9fa;
    --bg-section: #f4f1ec;
    --white: #ffffff;
}

/* Typography
   ========================================================================== */

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'EB Garamond', serif;
    color: var(--primary);
    font-weight: 600;
}

.section-title {
    font-size: 2.25rem;
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin-top: 0.5rem;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
}

/* Navbar
   ========================================================================== */

.navbar {
    padding: 0.75rem 0;
    background-color: var(--white);
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.12);
}

.navbar-brand img {
    height: 65px;
    transition: height 0.3s ease;
}

.navbar.scrolled .navbar-brand img {
    height: 50px;
}

.navbar .nav-link {
    color: var(--primary) !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--accent) !important;
}

/* Divider tra link principali e policy */
.nav-divider {
    width: 1px;
    background: rgba(0, 0, 0, 0.12);
    margin: 0.25rem 0.5rem;
    align-self: stretch;
}

/* Link secondari (Privacy, Cookie) */
.navbar .nav-link-secondary {
    font-size: 0.75rem;
    color: var(--text-light) !important;
    letter-spacing: 0.3px;
    text-transform: none;
}

.navbar .nav-link-secondary:hover {
    color: var(--accent) !important;
}

/* Hero
   ========================================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(26, 35, 50, 0.92) 0%,
        rgba(26, 35, 50, 0.75) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--white);
    font-weight: 700;
    line-height: 1.2;
}

.hero .lead {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
}

.hero .accent-text {
    color: var(--accent);
}

.btn-accent {
    background-color: var(--accent);
    color: var(--white);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-accent:hover {
    background-color: var(--accent-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(200, 164, 114, 0.4);
}

.btn-outline-light:hover {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* Sections
   ========================================================================== */

section {
    padding: 5rem 0;
}

.bg-section {
    background-color: var(--bg-section);
}

/* Studio Section
   ========================================================================== */

#studio .studio-text {
    font-size: 1.05rem;
    line-height: 1.9;
}

#studio .studio-img {
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.year-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary);
    color: var(--accent);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-family: 'EB Garamond', serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Aree di Intervento
   ========================================================================== */

.area-card {
    background: var(--white);
    border: none;
    border-radius: 8px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.area-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.area-card .icon {
    width: 70px;
    height: 70px;
    background: var(--bg-section);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.75rem;
    color: var(--accent);
    transition: all 0.3s ease;
}

.area-card:hover .icon {
    background: var(--primary);
    color: var(--accent);
}

.area-card h5 {
    font-family: 'EB Garamond', serif;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.area-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0;
}

.area-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.area-card ul li {
    font-size: 0.88rem;
    color: var(--text-light);
    padding: 0.3rem 0;
    padding-left: 1.2rem;
    position: relative;
}

.area-card ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* Avvocati
   ========================================================================== */

.avvocato-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
}

.avvocato-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.avvocato-card .card-img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
}

.avvocato-card .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.avvocato-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.avvocato-card .card-body {
    padding: 1.5rem;
    text-align: center;
}

.avvocato-card h5 {
    font-family: 'EB Garamond', serif;
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.avvocato-card .specializzazione {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.avvocato-card a,
.contact-info a {
    word-break: break-all;
    overflow-wrap: anywhere;
}

/* Contatti
   ========================================================================== */

#contatti .contact-info {
    height: 100%;
}

#contatti .contact-info .d-flex > div {
    min-width: 0;
}

#contatti .contact-info i {
    color: var(--accent);
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

#contatti .contact-info a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

#contatti .contact-info a:hover {
    color: var(--accent);
}

.contact-form .form-control,
.contact-form .form-select {
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(200, 164, 114, 0.25);
}

.contact-form .form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.contact-form .btn-send {
    background-color: var(--primary);
    color: var(--white);
    padding: 0.75rem 2.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    border: none;
    transition: all 0.3s ease;
}

.contact-form .btn-send:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(200, 164, 114, 0.4);
}

.contact-form .btn-send:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.map-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 300px;
}

.map-container iframe {
    width: 100%;
    height: 300px;
    border: 0;
}

/* Iframe senza src: nascosto */
.map-container iframe:not([src]) {
    display: none;
}

/* Placeholder mappa (visibile quando iframe è bloccato) */
.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: var(--bg-section);
    text-align: center;
    padding: 2rem;
}

/* Nasconde il placeholder quando l'iframe ha src */
.map-container iframe[src] ~ .map-placeholder {
    display: none;
}

/* Alert messages */
.alert-form {
    font-size: 0.9rem;
    border-radius: 6px;
}

/* Footer
   ========================================================================== */

footer {
    background-color: var(--primary);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

footer a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

footer .footer-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Honeypot - campo nascosto anti-spam */
.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* Back to top
   ========================================================================== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: var(--accent);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    cursor: pointer;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent);
    color: var(--white);
    transform: translateY(-3px);
}

/* Responsive
   ========================================================================== */

@media (max-width: 991.98px) {
    .hero {
        background-attachment: scroll;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 1.85rem;
    }

    section {
        padding: 3.5rem 0;
    }

    .navbar-collapse {
        background: var(--white);
        padding: 1rem;
        border-radius: 8px;
        margin-top: 0.5rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    .nav-divider {
        display: none !important;
    }

    .navbar .nav-link-secondary {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand img {
        height: 45px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .lead {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.6rem;
    }
}

/* Page content (privacy, cookie policy)
   ========================================================================== */

.page-content {
    padding-top: 120px;
    min-height: 100vh;
}

.page-content h1 {
    font-size: 2.25rem;
    margin-bottom: 2rem;
}

.page-content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.page-content h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.page-content p,
.page-content li {
    font-size: 0.95rem;
    line-height: 1.8;
}

.page-content ul {
    padding-left: 1.5rem;
}

/* Cookie Banner
   ========================================================================== */

#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    color: rgba(255, 255, 255, 0.9);
    padding: 1.5rem 0;
    z-index: 10000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

#cookie-banner.show {
    transform: translateY(0);
}

#cookie-banner h5 {
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#cookie-banner p {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

#cookie-banner a {
    color: var(--accent);
    text-decoration: underline;
}

#cookie-banner a:hover {
    color: var(--accent-dark);
}

#cookie-banner .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    margin: 0.25rem;
}

#cookie-banner .btn-accept {
    background-color: var(--accent);
    color: #fff;
    border: none;
}

#cookie-banner .btn-accept:hover {
    background-color: var(--accent-dark);
}

#cookie-banner .btn-reject {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#cookie-banner .btn-reject:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

#cookie-banner .btn-customize {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    text-decoration: underline;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

#cookie-banner .btn-customize:hover {
    color: var(--accent);
}

#cookie-banner .btn-save {
    background-color: var(--accent);
    color: #fff;
    border: none;
}

#cookie-banner .btn-save:hover {
    background-color: var(--accent-dark);
}

/* Cookie settings toggles */
.cookie-settings-group {
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
}

.cookie-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cookie-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.cookie-toggle label {
    font-size: 0.85rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
}
