/* ==========================================================================
   TANGANELLI e ASSOCIATI - Custom Skin
   Colori: Blu Navy #1e3a5f | Oro #c4a962
   ========================================================================== */

:root {
    --primary-color: #1e3a5f;
    --secondary-color: #c4a962;
    --tertiary-color: #f5f3ef;
    --quaternary-color: #e8e4dc;
    --dark-color: #1e3a5f;
    --light-color: #f9f8f6;
}

/* Primary Color */
.bg-primary,
.btn-primary,
.bg-color-primary {
    background-color: var(--primary-color) !important;
}

.text-primary,
.text-color-primary {
    color: var(--primary-color) !important;
}

.border-color-primary {
    border-color: var(--primary-color) !important;
}

.btn-primary {
    border-color: var(--primary-color) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #152a47 !important;
    border-color: #152a47 !important;
}

/* Secondary Color (Oro) */
.bg-secondary,
.bg-color-secondary {
    background-color: var(--secondary-color) !important;
}

.text-secondary,
.text-color-secondary {
    color: var(--secondary-color) !important;
}

.btn-secondary {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    background-color: #b39952 !important;
    border-color: #b39952 !important;
}

/* Tertiary Color */
.bg-tertiary,
.bg-color-tertiary {
    background-color: var(--tertiary-color) !important;
}

.text-color-tertiary {
    color: var(--secondary-color) !important;
}

/* Quaternary Color */
.bg-quaternary,
.bg-color-quaternary {
    background-color: var(--quaternary-color) !important;
}

/* Custom Header */
.header-top.bg-custom-color-1 {
    background-color: var(--tertiary-color) !important;
}

/* Links */
a:hover,
a:focus {
    color: var(--primary-color);
}

.text-color-hover-primary:hover {
    color: var(--primary-color) !important;
}

/* SVG Fill */
.svg-fill-color-primary {
    fill: var(--primary-color) !important;
}

.svg-fill-color-secondary {
    fill: var(--secondary-color) !important;
}

/* Nav */
.header-nav-main nav > ul > li > a:hover,
.header-nav-main nav > ul > li.active > a {
    color: var(--primary-color) !important;
}

.header-nav-main nav > ul > li > a.active {
    color: var(--primary-color) !important;
}

/* Buttons */
.btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

/* Cards & Boxes */
.card-glass,
.custom-card-glass-1 {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
}

/* Section backgrounds */
.bg-color-light {
    background-color: var(--light-color) !important;
}

/* Highlight Scribble */
.highlight-scribble-1 path {
    stroke: var(--secondary-color) !important;
}

/* Custom Elements */
.custom-el-1.bg-color-before-primary::before {
    background-color: var(--primary-color) !important;
}

/* Toggle/Accordion */
.toggle-title {
    color: var(--primary-color) !important;
}

/* Footer */
#footer {
    background-color: var(--light-color) !important;
}

/* Badge */
.badge-dark {
    background-color: var(--primary-color) !important;
}

/* Counter */
.counter span {
    color: var(--primary-color) !important;
}

/* Custom Tanganelli Styles */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a4a73 100%);
}

.section-gold-accent {
    border-left: 4px solid var(--secondary-color);
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(30, 58, 95, 0.15);
}

.service-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--tertiary-color);
    border-radius: 50%;
    margin-bottom: 1rem;
}

.service-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Scrollspy Active */
.nav-link.active {
    color: var(--primary-color) !important;
}

/* Custom Quote */
blockquote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1.5rem;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .hero-title {
        font-size: 2.5rem !important;
    }
}

/* Animation */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   COOKIE BANNER & MODALS
   ========================================================================== */

/* Cookie Settings Button */
.cookie-settings-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cookie-settings-btn:hover {
    background-color: var(--secondary-color);
    transform: scale(1.1);
}

.cookie-settings-btn i {
    color: #ffffff;
    font-size: 20px;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(30, 58, 95, 0.98);
    color: #ffffff;
    padding: 20px 0;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    display: none;
}

.cookie-banner.show {
    display: block;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-text {
    flex: 1;
}

.cookie-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #ffffff;
}

.cookie-text a {
    color: var(--secondary-color) !important;
    text-decoration: underline;
}

.cookie-text a:hover {
    color: #ffffff !important;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-buttons .btn {
    white-space: nowrap;
}

@media (max-width: 991px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .cookie-buttons .btn {
        flex: 1;
        min-width: 120px;
    }
}

/* Modals */
.modal-content {
    border-radius: 10px;
    border: none;
    background-color: #ffffff !important;
}

.modal-header {
    background-color: var(--primary-color);
    color: #ffffff;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.modal-header .modal-title {
    color: #ffffff !important;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 30px;
    background-color: #ffffff !important;
    color: #333333 !important;
}

.modal-body p,
.modal-body li,
.modal-body ul {
    color: #333333 !important;
}

.modal-body h6 {
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 10px;
}

.modal-body h6:first-child {
    margin-top: 0;
}

.modal-footer {
    background-color: #f8f9fa;
}

.modal-footer .btn-primary {
    color: #ffffff !important;
}

/* ==========================================================================
   FIX: Testi su background scuro
   ========================================================================== */

/* Hero e CTA - testi bianchi */
.hero-tanganelli .text-color-dark,
.hero-tanganelli .text-dark,
.hero-tanganelli h1,
.hero-tanganelli h2,
.hero-tanganelli p,
.bg-primary .text-color-dark,
.bg-primary .text-dark,
.bg-primary h1,
.bg-primary h2,
.bg-primary h3,
.bg-primary p,
#footer.bg-color-dark .text-color-dark,
#footer.bg-color-dark h1,
#footer.bg-color-dark h2,
#footer.bg-color-dark h3,
#footer.bg-color-dark p,
#footer.bg-color-dark a {
    color: #ffffff !important;
}

/* Footer dark */
#footer.bg-color-dark {
    background-color: var(--primary-color) !important;
}

#footer.bg-color-dark a:hover {
    color: var(--secondary-color) !important;
}

/* ==========================================================================
   FIX: Icone servizi
   ========================================================================== */

.service-card .service-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color) !important;
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.service-card .service-icon i {
    font-size: 1.8rem;
    color: #ffffff !important;
}

/* ==========================================================================
   FIX: Footer migliorato
   ========================================================================== */

#footer .footer-logo img {
    max-height: 60px;
    width: auto;
}

#footer .footer-links a {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 1rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

#footer .footer-links a:hover {
    color: var(--secondary-color) !important;
}

#footer hr {
    border-color: rgba(255, 255, 255, 0.2);
}

#footer .small-text {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* btn outline light su footer scuro */
#footer .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

#footer .btn-outline-light:hover,
#footer.bg-color-dark .btn-outline-light:hover,
#footer.bg-color-dark a.btn-outline-light:hover {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: var(--primary-color) !important;
}

#footer .btn-outline-light:hover i,
#footer.bg-color-dark .btn-outline-light:hover i {
    color: var(--primary-color) !important;
}

/* btn-light hover su background scuri (Hero, CTA) */
.hero-tanganelli .btn-light:hover,
.bg-primary .btn-light:hover {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: var(--primary-color) !important;
}

.hero-tanganelli .btn-light:hover i,
.bg-primary .btn-light:hover i {
    color: var(--primary-color) !important;
}

/* btn-primary hover (Header Contattaci) */
.header-body .btn-primary:hover,
.header-body .btn-primary:hover span {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: var(--primary-color) !important;
}

/* ==========================================================================
   FIX: Testi ingranditi +50%
   ========================================================================== */

/* Hero badge */
.hero-tanganelli .badge {
    font-size: 1.05rem !important;
}

/* Badges generici (Chi Siamo, Contatti, I Nostri Servizi, etc.) */
.badge.rounded-pill {
    font-size: 1.05rem !important;
}

/* Valori - sottotitoli */
.value-item p.text-muted.small {
    font-size: 0.975rem !important;
}

/* Team - ruoli (Dottore Commercialista, Revisore Legale) */
.team-member p.text-muted.small {
    font-size: 0.975rem !important;
}

/* Of Counsel - descrizione */
.of-counsel-card p.text-muted.small {
    font-size: 0.975rem !important;
}

/* Badge Ordine */
.badge-ordine strong.small,
.badge-ordine .small {
    font-size: 0.975rem !important;
}

/* Footer sottotitolo */
#footer small {
    font-size: 1.05rem !important;
}

/* ==========================================================================
   FIX: Sticky Header
   ========================================================================== */

#header .header-body {
    transition: all 0.3s ease;
    border-bottom-color: white !important;
    background-color: #ffffff !important;
}

/* Nasconde completamente il top header quando sticky */
#header.sticky-active .header-top,
html.sticky-header-active #header .header-top {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

#header.sticky-active .header-body,
html.sticky-header-active #header .header-body {
    padding: 0 !important;
    min-height: auto !important;
    border-bottom-color: white !important;
}

#header.sticky-active .header-body .container > .row,
html.sticky-header-active #header .header-body .container > .row {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

#header.sticky-active img[alt="Tanganelli e Associati"],
html.sticky-header-active #header img[alt="Tanganelli e Associati"] {
    height: 40px !important;
}

/* Logo header */
#header .header-logo-img {
    max-height: 50px;
    width: auto;
    transition: all 0.3s ease;
}

#header.sticky-active .header-logo-img,
html.sticky-header-active #header .header-logo-img {
    max-height: 40px !important;
    height: 40px !important;
}

#header .logo-fallback {
    display: none !important;
}

/* Solo se l'immagine fallisce, il JS mostrerà il fallback */
#header .logo-fallback.show {
    display: flex !important;
}

/* Override Porto sticky calculations */
#header.sticky-active,
#header[class*="sticky"] {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1030 !important;
}

/* Fix spazio bianco quando sticky è attivo */
html.sticky-header-active .body,
html.sticky-header-active .main,
html.sticky-header-active #hero {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Rimuove il margin-top che Porto aggiunge al .main quando sticky */
.sticky-header-active .main {
    margin-top: -40px !important;
}

/* Mobile: header sempre visibile (fixed) */
@media (max-width: 991px) {
    #header,
    #header.header-effect-shrink {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1030 !important;
        width: 100% !important;
        background-color: #ffffff !important;
    }

    #header .header-body {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        background-color: #ffffff !important;
    }

    /* Hero padding mobile */
    #hero.hero-tanganelli {
        padding-top: 90px !important;
        padding-bottom: 75px !important;
    }

    /* Rimuove qualsiasi margine/padding extra */
    .body,
    .main {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
}
