/* =========================================================
   ATS Argeş - Modern responsive stylesheet
   Mobile-first design, clean & simple.
   ========================================================= */

/* ----- Reset & base ----- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: #1f2937;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

a { color: #0a6cb4; text-decoration: none; transition: color .2s ease; }
a:hover { color: #074a7c; text-decoration: underline; }

h1, h2, h3, h4 {
    font-weight: 700;
    color: #0c1a2b;
    line-height: 1.25;
    margin: 0 0 .5em;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.3rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1rem; }

ul { padding-left: 1.25rem; margin: 0 0 1rem; }
ul li { margin-bottom: .35rem; }

address { font-style: normal; }

button { font-family: inherit; cursor: pointer; }

/* ----- Layout helpers ----- */
.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.section {
    padding: 3rem 0;
}
.section-alt { background: #f5f8fc; }

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}
.section-title {
    display: inline-block;
    position: relative;
    padding-bottom: .65rem;
    margin: 0;
}
.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #0a6cb4;
    border-radius: 2px;
}

.subsection-title {
    margin-top: 2rem;
    color: #0a6cb4;
    border-left: 4px solid #0a6cb4;
    padding-left: .75rem;
}

.section-image {
    margin: 0 0 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(12, 26, 43, .08);
}
.section-image img {
    width: 100%;
    aspect-ratio: 21/9;
    object-fit: cover;
}

.prose p { font-size: 1rem; color: #374151; }

.motto {
    text-align: center;
    color: #0a6cb4;
    font-size: clamp(1.2rem, 2.2vw, 1.5rem);
    font-weight: 600;
    margin: 1.25rem 0;
    letter-spacing: .02em;
}

/* ----- Buttons ----- */
.btn {
    display: inline-block;
    padding: .7rem 1.4rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: .95rem;
    text-align: center;
    border: 2px solid transparent;
    transition: all .2s ease;
    text-decoration: none;
    cursor: pointer;
}
.btn-lg { padding: .9rem 1.8rem; font-size: 1rem; }
.btn-primary { background: #0a6cb4; color: #fff; }
.btn-primary:hover { background: #074a7c; color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: #0a6cb4; border-color: #0a6cb4; }
.btn-ghost:hover { background: #0a6cb4; color: #fff; text-decoration: none; }

/* ----- Header / nav ----- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid #e5e7eb;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    gap: 1rem;
}
.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 48px; width: auto; }

.nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #0c1a2b;
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav {
    position: fixed;
    inset: 64px 0 0 0;
    background: #fff;
    padding: 1.5rem 1.25rem 2rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
}
.primary-nav.is-open { transform: translateX(0); }
.primary-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.primary-nav a {
    display: block;
    padding: .75rem .25rem;
    color: #0c1a2b;
    font-weight: 500;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
}
.primary-nav a:hover { color: #0a6cb4; }
.nav-portal { width: 100%; }

/* ----- Hero / Slider ----- */
.hero {
    position: relative;
    min-height: 60vh;
    max-height: 620px;
    overflow: hidden;
    background: #0c1a2b;
}
.hero-slider {
    position: absolute;
    inset: 0;
    display: flex;
    width: 500%;
    animation: heroFade 25s ease-in-out infinite;
}
.hero-slide {
    position: relative;
    width: 20%;
    flex-shrink: 0;
    height: 100%;
}
.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: kenburns 8s ease-in-out infinite alternate;
}
@keyframes heroFade {
    0%, 18% { transform: translateX(0); }
    20%, 38% { transform: translateX(-20%); }
    40%, 58% { transform: translateX(-40%); }
    60%, 78% { transform: translateX(-60%); }
    80%, 100% { transform: translateX(-80%); }
}
@keyframes kenburns {
    0% { transform: scale(1.0); }
    100% { transform: scale(1.08); }
}

.hero-overlay {
    position: relative;
    z-index: 2;
    min-height: 60vh;
    max-height: 620px;
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, rgba(12, 26, 43, .45) 0%, rgba(12, 26, 43, .75) 100%);
}
.hero-content {
    color: #fff;
    text-align: center;
    padding: 3rem 1.25rem;
    max-width: 760px;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: .25em;
    font-size: 2rem;
    font-weight: 600;
    color: #c7e0f5;
    margin: 0 0 1rem;
}
.hero h1 {
    color: #fff;
    font-size: clamp(2rem, 5.5vw, 3.4rem);
    margin-bottom: 1rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}
.hero-sub {
    color: #e2e8f0;
    font-size: clamp(1rem, 2vw, 1.15rem);
    margin: 0 0 1.75rem;
}
.social-links {
    margin-top: 1.75rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}
.social-links a {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .80);
    border-radius: 50%;
    transition: background .2s ease, transform .2s ease;
}
.social-links a:hover { background: #b4260a; transform: translateY(-2px); }
.social-links img { width: 20px; height: 20px; }

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    border: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    transition: background .2s ease;
}
.slider-btn:hover { background: rgba(10, 108, 180, .85); }
.slider-prev { left: .75rem; }
.slider-next { right: .75rem; }

/* ----- MVV grid ----- */
.mvv-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 1.5rem;
}
.mvv-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform .2s ease, box-shadow .2s ease;
}
.mvv-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(12, 26, 43, .08); }
.mvv-card h3 { color: #0a6cb4; margin-bottom: .5rem; }

/* ----- Service blocks ----- */
.service {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 16px rgba(12, 26, 43, .05);
    border: 1px solid #eef2f7;
    overflow: hidden;
}
.service h3 { color: #0a6cb4; }
.service-image-left, .service-image-right {
    width: 100%;
    max-width: 180px;
    height: auto;
    margin: 0 auto 1rem;
    display: block;
}

/* ----- Management / ISO blocks ----- */
.iso-block {
    background: #fff;
    border-left: 4px solid #0a6cb4;
    padding: 1.25rem 1.5rem;
    margin: 1.25rem 0;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 4px 16px rgba(12, 26, 43, .05);
}
.iso-block h3 { color: #0a6cb4; margin-bottom: .5rem; }

/* Galleries (ISO, Autorizaţii, Photos) */
.iso-gallery, .auth-gallery, .photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .75rem;
    margin-top: 1.5rem;
}
.iso-gallery a, .auth-gallery a, .photo-gallery a {
    display: block;
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(12, 26, 43, .08);
    transition: transform .25s ease, box-shadow .25s ease;
    background: #f1f5f9;
}
.iso-gallery a:hover, .auth-gallery a:hover, .photo-gallery a:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 20px rgba(12, 26, 43, .15);
}
.iso-gallery img, .auth-gallery img, .photo-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ----- Autorizaţii blocks ----- */
.auth-block {
    background: #fff;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(12, 26, 43, .04);
}
.auth-block h3 { color: #0a6cb4; }
.auth-block h4 { color: #0c1a2b; margin-top: 1rem; }

/* ----- Utilaje ----- */
.utilaje-content { font-size: 1rem; color: #374151; }
.utilaje-content p { overflow: hidden; }
.float-left, .float-right {
    display: block;
    max-width: 220px;
    margin: 0 auto 1rem;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(12, 26, 43, .1);
}

/* ----- Portofolio ----- */
.portofolio-block {
    background: #fff;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(12, 26, 43, .04);
}
.portofolio-block h4 { color: #0c1a2b; margin-bottom: .75rem; }

/* ----- Fonduri Europene / PDF embeds ----- */
.pdf-embed {
    margin: 1.5rem 0;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(12, 26, 43, .05);
}
.pdf-embed h3 {
    padding: 1rem 1.25rem;
    margin: 0;
    color: #0a6cb4;
    background: #f5f8fc;
    border-bottom: 1px solid #e5e7eb;
}
.pdf-embed iframe {
    width: 100%;
    height: 600px;
    border: 0;
    display: block;
}

/* ----- Contact ----- */
.contact-form {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(12, 26, 43, .05);
    margin: 0 0 1.5rem;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.form-field { display: flex; flex-direction: column; margin-bottom: 1rem; }
.form-field label {
    font-weight: 600;
    color: #0c1a2b;
    margin-bottom: .4rem;
    font-size: .9rem;
}
.form-field input,
.form-field textarea {
    width: 100%;
    padding: .7rem .85rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
    background: #fff;
    color: #1f2937;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.form-field input:focus,
.form-field textarea:focus {
    outline: 0;
    border-color: #0a6cb4;
    box-shadow: 0 0 0 3px rgba(10, 108, 180, .15);
}
.form-field textarea { resize: vertical; min-height: 120px; }

.form-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: .5rem;
}

.contact-info {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(12, 26, 43, .05);
    margin: 1.5rem 0;
}
.contact-info p { margin: .35rem 0; }

.map-embed {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(12, 26, 43, .05);
    margin: 1.5rem 0;
}

/* ----- Footer ----- */
.site-footer {
    background: #0c1a2b;
    color: #cbd5e1;
    padding: 1.5rem 0;
    text-align: center;
    font-size: .9rem;
}
.copyright { margin: 0; }

/* ----- Back to top ----- */
.back-to-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0a6cb4;
    color: #fff;
    border: 0;
    font-size: 1.25rem;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(10, 108, 180, .35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
    z-index: 40;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: #074a7c; }

/* ----- Image modal (gallery lightbox) ----- */
.img-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(12, 26, 43, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn .2s ease;
}
.img-modal[hidden] { display: none; }
.img-modal figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.img-modal img {
    max-width: 92vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}
.img-modal figcaption {
    color: #e2e8f0;
    text-align: center;
    font-size: .9rem;
    max-width: 90vw;
    word-break: break-word;
}
.img-modal-close, .img-modal-prev, .img-modal-next {
    position: absolute;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border: 0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    line-height: 1;
    transition: background .2s ease;
}
.img-modal-close:hover, .img-modal-prev:hover, .img-modal-next:hover { background: rgba(10, 108, 180, .9); }
.img-modal-close { bottom: 1rem; right: 1rem; font-size: 1.5rem; }
.img-modal-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.img-modal-next { right: 1rem; top: 50%; transform: translateY(-50%); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =========================================================
   Responsive breakpoints (mobile-first upgrades)
   ========================================================= */

@media (min-width: 640px) {
    .section { padding: 4rem 0; }
    .mvv-grid { grid-template-columns: repeat(3, 1fr); }
    .form-row { grid-template-columns: 1fr 1fr; }
    .iso-gallery, .auth-gallery, .photo-gallery { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .float-left { float: left; margin: 0 1.25rem .5rem 0; }
    .float-right { float: right; margin: 0 0 .5rem 1.25rem; }
}

@media (min-width: 880px) {
    .nav-toggle { display: none; }
    .primary-nav {
        position: static;
        transform: none;
        background: transparent;
        padding: 0;
        box-shadow: none;
        overflow: visible;
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }
    .primary-nav ul {
        flex-direction: row;
        gap: 1.25rem;
        margin: 0;
    }
    .primary-nav a {
        padding: .25rem 0;
        border: 0;
        font-size: .95rem;
    }
    .nav-portal { width: auto; }
    .section { padding: 5rem 0; }
    .service-image-left { float: left; max-width: 140px; margin: 0 1.25rem .5rem 0; }
    .service-image-right { float: right; max-width: 140px; margin: 0 0 .5rem 1.25rem; }
    .utilaje-content p { overflow: visible; }
}

@media (min-width: 1100px) {
    .section { padding: 6rem 0; }
    .section-image img { aspect-ratio: 21/7; }
    .iso-gallery, .auth-gallery, .photo-gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0s !important;
        scroll-behavior: auto !important;
    }
}


/* ==========================================
   REPARARE FINALĂ: ÎNĂLȚIME FIXĂ ȘI SIGURĂ PENTRU MOBIL
   ========================================== */

@media screen and (max-width: 991px) {
    /* 1. Header-ul fix rămâne neschimbat la 70px */
    header.site-header#siteHeader {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 70px !important;
        max-height: 70px !important;
        background-color: #ffffff !important;
        z-index: 99999 !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
        overflow: visible !important;
    }

    /* 2. FORȚĂM containerul meniului să aibă o înălțime generoasă, fixă */
    nav.primary-nav#primaryNav {
        position: fixed !important;
        top: 70px !important;
        left: 0 !important;
        width: 100% !important;
        
        /* Modificarea cheie: Îi dăm o înălțime minimă clară ca să nu se mai poată prăbuși */
        height: auto !important;
        min-height: 440px !important; /* Oferă spațiu fizic garantat pentru toate elementele */
        max-height: calc(100vh - 70px) !important;
        
        background-color: #ffffff !important;
        z-index: 99998 !important;
        box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
        padding: 15px 20px !important;
        box-sizing: border-box !important;
        overflow-y: auto !important;
    }

    /* Declanșator afișare la click */
    .nav-toggle[aria-expanded="true"] ~ .primary-nav,
    nav.primary-nav#primaryNav.active,
    nav.primary-nav#primaryNav.open,
    nav.primary-nav#primaryNav.show {
        display: block !important; /* Schimbat din flex în block pentru stabilitate structurală */
    }

    /* 3. Structura listei din interior */
    nav.primary-nav#primaryNav ul {
        display: block !important; /* Dezactivăm flexbox-ul vechi care prăbușea zona */
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 0 15px 0 !important;
        list-style: none !important;
    }

    nav.primary-nav#primaryNav ul li {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Spațierea optimă a butoanelor (ușor mărită pentru a fi ergonomică) */
    nav.primary-nav#primaryNav ul li a {
        display: block !important;
        width: 100% !important;
        padding: 11px 5px !important; /* Spațiu perfect pentru deget */
        font-size: 15px !important;   /* Text clar și vizibil */
        line-height: 1.3 !important;
        color: #333333 !important;
        text-align: left !important;
        border-bottom: 1px solid #eeeeee !important;
        box-sizing: border-box !important;
    }

    /* Butonul de Portal Clienți */
    nav.primary-nav#primaryNav .nav-portal {
        display: block !important;
        width: 100% !important;
        padding: 12px !important;
        font-size: 15px !important;
        text-align: center !important;
        margin-top: 10px !important;
        box-sizing: border-box !important;
    }

    body {
        padding-top: 70px !important;
    }
}

/* ==========================================
   SIGURANȚĂ PENTRU DESKTOP
   ========================================== */
@media screen and (min-width: 992px) {
    header.site-header#siteHeader { position: relative !important; height: auto !important; max-height: none !important; }
    nav.primary-nav#primaryNav { position: relative !important; top: auto !important; display: flex !important; flex-direction: row !important; background-color: transparent !important; box-shadow: none !important; max-height: none !important; padding: 0 !important; min-height: 0 !important; }
    nav.primary-nav#primaryNav ul { display: flex !important; flex-direction: row !important; margin: 0 !important; }
    nav.primary-nav#primaryNav ul li a { border-bottom: none !important; font-size: initial !important; padding: initial !important; }
}

