/* ===========================
   LIBERAMENTIS - Main Stylesheet
   Dott.ssa Alessandra Temperini
   =========================== */

/* --- Base & Reset --- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f5f5f4;
}
::-webkit-scrollbar-thumb {
    background: #a8a29e;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #78716c;
}

/* --- Logo Space --- */
.logo-img {
    max-height: 48px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.logo-img:hover {
    transform: scale(1.05);
}
.logo-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a5a46, #3fa683);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}
.logo-placeholder:hover {
    transform: scale(1.08);
}

/* --- Navigation --- */
.nav-main {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-main.scrolled {
    background: rgba(26, 90, 70, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}
.nav-main.scrolled .nav-link-item {
    color: rgba(255, 255, 255, 0.9);
}
.nav-main.scrolled .nav-brand-name {
    color: #fff;
}
.nav-main.scrolled .nav-brand-role {
    color: rgba(255, 255, 255, 0.7);
}

.nav-link-item {
    position: relative;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-brand-name {
    color: #fff;
}
.nav-brand-role {
    color: rgba(255, 255, 255, 0.7);
}
.nav-link-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2.5px;
    background: linear-gradient(90deg, #2a8c6b, #3fa683);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.nav-link-item:hover::after,
.nav-link-item.active::after {
    width: 100%;
}
.nav-link-item:hover {
    color: #3fa683;
}
.nav-link-item.active {
    color: #2a8c6b;
}

.nav-cta-btn {
    padding: 0.65rem 1.75rem;
    background: linear-gradient(135deg, #1f7056, #2a8c6b);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(42, 140, 107, 0.3);
}
.nav-cta-btn:hover {
    background: linear-gradient(135deg, #2a8c6b, #3fa683);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(42, 140, 107, 0.4);
}

/* --- Mobile Menu --- */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 1) !important;
}
.mobile-menu.active {
    transform: translateX(0);
}

.mobile-nav-link {
    color: #1f7056 !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}
.mobile-nav-link:hover {
    color: #164a3a !important;
    background: rgba(42, 140, 107, 0.08);
}

.hamburger-line {
    transition: all 0.3s ease;
}
.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* --- Hero Section --- */
.hero-gradient {
    background: linear-gradient(135deg,
        rgba(18, 61, 49, 0.88) 0%,
        rgba(26, 90, 70, 0.78) 50%,
        rgba(42, 140, 107, 0.62) 100%);
}

/* --- Parallax Layers --- */
.parallax-container {
    position: relative;
    overflow: hidden;
}
.parallax-bg {
    position: absolute;
    inset: -20%;
    will-change: transform;
    transition: none;
}
.parallax-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.parallax-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.parallax-shape {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
    pointer-events: none;
}
.parallax-shape-1 {
    width: 300px;
    height: 300px;
    top: -50px;
    right: -50px;
    background: rgba(42, 140, 107, 0.08);
    filter: blur(60px);
}
.parallax-shape-2 {
    width: 400px;
    height: 400px;
    bottom: -100px;
    left: -80px;
    background: rgba(212, 144, 46, 0.08);
    filter: blur(80px);
}
.parallax-shape-3 {
    width: 200px;
    height: 200px;
    top: 40%;
    left: 50%;
    background: rgba(255, 255, 255, 0.05);
    filter: blur(40px);
}

/* --- Glass Card --- */
.glass-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- Service Cards --- */
.service-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.service-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 60px -12px rgba(18, 61, 49, 0.15);
}
.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}
.service-icon {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Text Gradient --- */
.text-gradient {
    background: linear-gradient(135deg, #1a5a46, #3fa683);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Animations --- */
.float-animation {
    animation: float 6s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.pulse-dot {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.reveal-up {
    opacity: 0;
    transform: translateY(40px);
}

.counter-number {
    font-variant-numeric: tabular-nums;
}

/* --- Background Patterns --- */
.bg-pattern {
    background-image:
        radial-gradient(circle at 25% 25%, rgba(42, 140, 107, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(212, 144, 46, 0.03) 0%, transparent 50%);
}

/* --- Parallax Sections --- */
.section-parallax {
    position: relative;
    overflow: hidden;
}
.section-parallax-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.section-parallax-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    will-change: transform;
}
.section-parallax > .relative {
    position: relative;
    z-index: 1;
}

/* --- Stats Section Parallax --- */
.stats-parallax {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}
@supports (-webkit-overflow-scrolling: touch) {
    .stats-parallax {
        background-attachment: scroll;
    }
}

/* --- Quote Parallax --- */
.quote-parallax {
    position: relative;
    overflow: hidden;
}
.quote-parallax-inner {
    position: relative;
    z-index: 1;
}

/* ===========================
   RESPONSIVE IMPROVEMENTS
   =========================== */

/* Extra small (phones <375px) */
@media (max-width: 374px) {
    .hero-title {
        font-size: 2rem;
        line-height: 1.15;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .hero-description {
        font-size: 0.875rem;
    }
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    .hero-buttons a {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    .section-title {
        font-size: 1.75rem;
    }
    .service-card {
        padding: 1.5rem;
    }
}

/* Small phones */
@media (min-width: 375px) and (max-width: 639px) {
    .hero-title {
        font-size: 2.25rem;
        line-height: 1.15;
    }
    .hero-subtitle {
        font-size: 1.125rem;
    }
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    .hero-buttons a {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    .section-title {
        font-size: 2rem;
    }
}

/* Tablets */
@media (min-width: 640px) and (max-width: 1023px) {
    .hero-title {
        font-size: 3rem;
    }
    .section-title {
        font-size: 2.5rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .hero-title {
        font-size: 3.75rem;
    }
    .section-title {
        font-size: 3rem;
    }
}

/* Mobile navbar styling */
@media (max-width: 1023px) {
    .nav-main {
        background: rgba(26, 90, 70, 0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    }
    .nav-main .nav-brand-name {
        color: #fff;
    }
    .nav-main .nav-brand-role {
        color: rgba(255, 255, 255, 0.7);
    }
    .nav-main .hamburger-line {
        background-color: #fff;
    }
}

/* Fix parallax on mobile */
@media (max-width: 768px) {
    .parallax-bg {
        inset: -10%;
    }
    .glass-card-hero {
        display: none;
    }
    .stats-parallax {
        background-attachment: scroll;
    }
}

/* Footer responsive */
@media (max-width: 639px) {
    .footer-grid {
        text-align: center;
    }
    .footer-brand {
        align-items: center;
    }
}

/* Ensure tap targets are at least 44px on mobile */
@media (max-width: 1023px) {
    .mobile-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* --- Cookie Consent Banner --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.12);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.cookie-banner.visible {
    transform: translateY(0);
}
.cookie-banner-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}
.cookie-text {
    flex: 1;
    min-width: 280px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #44403c;
}
.cookie-text a {
    color: #1f7056;
    text-decoration: underline;
    font-weight: 500;
}
.cookie-text a:hover {
    color: #2a8c6b;
}
.cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}
.cookie-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}
.cookie-btn-accept {
    background: #1f7056;
    color: #fff;
}
.cookie-btn-accept:hover {
    background: #2a8c6b;
    box-shadow: 0 4px 12px rgba(42, 140, 107, 0.3);
}
.cookie-btn-reject {
    background: transparent;
    color: #57534e;
    border: 1.5px solid #d6d3d1;
}
.cookie-btn-reject:hover {
    background: #f5f5f4;
    border-color: #a8a29e;
}
.cookie-btn-settings {
    background: transparent;
    color: #1f7056;
    border: 1.5px solid #1f7056;
}
.cookie-btn-settings:hover {
    background: #f0f7f4;
}

/* Cookie Settings Panel */
.cookie-settings-panel {
    display: none;
    padding: 1rem 1.5rem 0.5rem;
    max-width: 1280px;
    margin: 0 auto;
    border-top: 1px solid #e7e5e4;
}
.cookie-settings-panel.open {
    display: block;
}
.cookie-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f5f5f4;
}
.cookie-category:last-child {
    border-bottom: none;
}
.cookie-category-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #292524;
    margin-bottom: 0.125rem;
}
.cookie-category-info p {
    font-size: 0.75rem;
    color: #78716c;
}
/* Toggle switch */
.cookie-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: #d6d3d1;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}
.cookie-toggle input:checked + .cookie-toggle-slider {
    background: #1f7056;
}
.cookie-toggle input:checked + .cookie-toggle-slider::before {
    transform: translateX(20px);
}
.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 639px) {
    .cookie-banner-inner {
        flex-direction: column;
        padding: 1rem;
        align-items: stretch;
    }
    .cookie-text {
        min-width: unset;
        font-size: 0.8125rem;
    }
    .cookie-buttons {
        flex-direction: column;
    }
    .cookie-btn {
        text-align: center;
        padding: 0.75rem 1rem;
    }
}
