/* ===== Header layout (desktop) ===== */
:root {
    --header-h: 72px;
    --logo-h: 56px;

    --height-logo: 10rem;
    --hieght-logo-shrinked: 6rem; /* logo height after scroll */
}

html {
    scroll-padding-top: var(--hieght-logo-shrinked);
}

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

body {
    font-family: "Arial", sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
}

header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(1.1) blur(8px);
    border-bottom: 1px solid #e2e8f0;
}

header .container {
    display: flex;
    align-items: center; /* <-- vertical centering */
    justify-content: space-between;
    padding: 0 2rem !important; /* override old nav padding */
    transition: min-height 0.25s ease, padding 0.25s ease;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.logo {
    height: var(--height-logo); /* control size here */
    width: auto;
    display: block;
    transition: height 0.25s ease, transform 0.25s ease;
    transform-origin: left center;
}

.certificate {
    height: var(--height-logo);
    width: auto;
    transition: height 0.25s ease;
    padding: 0.5rem 0;
}

header.shrinked .certificate {
    height: var(--hieght-logo-shrinked);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20pt;
}

/* When scrolled: smaller bar + logo */
header.shrinked img.logo {
    height: var(--hieght-logo-shrinked);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

/* Hide icons on desktop, show only on mobile burger menu */
.nav-icon {
    display: none;
    margin-right: 0.5rem;
}

.nav-links a:hover {
    color: #1e40af;
    transform: translateY(-2px);
}

.nav-links a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: #1e40af;
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Burger button (hidden on desktop) */
.burger {
    display: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 8px;
}

.burger i {
    font-size: 1.8rem;
    color: #1e293b;
}

.burger:focus,
.burger:active {
    outline: none;
}

.burger:focus i,
.burger:active i,
.burger:hover i {
    color: #1e293b;
}

/* Hide certificate in nav-links on desktop */
.nav-certificate {
    display: none;
}

/* ===== Mobile: right drawer ===== */
@media (max-width: 768px) {
    .burger {
        display: block;
        position: relative;
        z-index: 1002;
    } /* show burger */
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 55%;
        height: 100vh;
        background: #fff;
        border-left: 1px solid #e5e7eb;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 120px 20px 20px; /* space for header + gap from burger icon */
        overflow-y: auto;
        transform: translateX(100%); /* hidden offscreen */
        transition: transform 0.3s ease;
        z-index: 1001;
    }
    .nav-links li {
        width: 100%;
    }
    .nav-links a {
        display: block;
        width: 100%;
        padding: 12px 4px;
    }

    /* Show icons in mobile burger menu */
    .nav-icon {
        display: inline;
    }

    /* Dim backdrop */
    .nav-dim[hidden] {
        display: none;
    }
    .nav-dim {
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, 0.45);
        backdrop-filter: blur(2px);
        z-index: 1000;
        height: 100vh;
    }

    /* When nav is open (body class set by JS) */
    body.nav-open .nav-links {
        transform: translateX(0);
    }
    body.nav-open .nav-dim {
        display: block;
    }

    /* Keep logo and burger vertically centered */
    header .container {
        align-items: center;
    }
    .nav-right {
        align-items: center;
        gap: 1rem;
    }

    /* Hide certificate next to logo on mobile */
    .brand-group .certificate {
        display: none;
    }

    /* Add spacing to nav items */
    .nav-links li:first-child {
        margin-top: 1rem;
    }

    .nav-links li:nth-child(4) {
        margin-bottom: 1rem;
    }

    /* Show certificate after Kontakt */
    .nav-certificate {
        display: block;
        text-align: center;
    }

    .nav-certificate img {
        height: 100px;
        width: auto;
    }
}

.hero {
    padding: 6rem 0;
    text-align: center;
    color: white;
    background: linear-gradient(
        45deg,
        rgba(30, 58, 138, 0.95),
        rgba(15, 23, 42, 0.95)
    );
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="white" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: slideInDown 1s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    animation: slideInUp 1s ease-out 0.3s both;
}

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

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: #dc2626;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: slideInUp 1s ease-out 0.6s both;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: #b91c1c;
}

.section {
    padding: 5rem 0;
    background: white;
}

.section:nth-child(even) {
    background: #f8fafc;
}

.section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #1e40af;
    position: relative;
}

.section h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(45deg, #1e40af, #dc2626);
    border-radius: 2px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #1e40af, #dc2626);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(30, 64, 175, 0.2);
    border-color: #1e40af;
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #1e40af;
}

.service-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.service-description {
    color: #64748b;
    line-height: 1.6;
}

.highlight-title {
    color: #1e40af;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.highlight-description {
    color: #475569;
    line-height: 1.6;
}

.section.contact {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    color: white;
    padding-bottom: 2rem;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: flex-start;
}

.contact-info {
    padding: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-item i {
    font-size: 1.5rem;
    margin-right: 1rem;
    color: #60a5fa;
}

.contact-item > a {
    text-decoration: none;
    color: white;
}

.contact-form {
    background: rgba(255, 255, 255, 0.1);
    padding: 3rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #e2e8f0;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #60a5fa;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.form-group select option {
    background: #1e3a8a;
    color: white;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

footer {
    background: #0f172a;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
}

@media (max-width: 768px) {
    header .container {
        grid-template-columns: 1fr; /* full width each */
        height: auto;
        row-gap: 10px;
        padding: 12px 16px;
    }
    #logo {
        height: 40px;
    }
    .nav-links {
        justify-self: start;
        flex-wrap: wrap;
        gap: 1rem;
    }
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.success-message {
    background: #059669;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}

.error-message {
    background: #dc2626;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}


/* BACKDROP */
.nav-dim[hidden] {
    display: none;
}

.nav-dim {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.nav-open .nav-dim {
    opacity: 1;
}

/* ===== FORM VALIDATION STYLES ===== */
.field-wrapper {
    position: relative;
}

.input-error {
    border: 2px solid #dc2626 !important;
    background-color: rgba(220, 38, 38, 0.1) !important;
}

.error-text {
    display: none;
    color: #fca5a5;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ===== CERTIFICATE LIGHTBOX ===== */
.certificate,
.nav-certificate img {
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.certificate:hover,
.nav-certificate img:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.lightbox[hidden] {
    display: none;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

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

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}