:root {
    --primary-color: #0077B6;
    --secondary-color: #CAF0F8;
    --background-color: #F8FAFC;
    --text-color: #1E293B;
    --accent-color: #FFFFFF;
    --grey-color: #999999;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: 16px;
}

body {
    font-family: inherit;
    font-weight: inherit;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    user-select: none;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

main {
    display: block;
}

header {
    background-color: var(--accent-color);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header img {
    max-width: 200px;
    height: auto;
    pointer-events: none;
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
}

.button-container {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.section-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    position: relative;
    transition: color 0.3s ease;
}

.section-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.section-link:not(.kontakt-link):hover {
    color: var(--primary-color);
}

.section-link:not(.kontakt-link):hover::after {
    width: 100%;
}

.kontakt-link {
    text-decoration: none;
    color: #FFFFFF;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: color 0.35s ease;
    overflow: hidden;
    z-index: 1;
    position: relative;
}

.kontakt-link::after {
    content: '';
    background: var(--accent-color);
    position: absolute;
    z-index: -1;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    transition: width 0.35s ease;
}

.kontakt-link:hover {
    color: var(--primary-color);
}

.kontakt-link:hover::after {
    width: 100%;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(202, 240, 248, 0.15), rgba(255, 255, 255, 0.9)), url('../images/Background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    opacity: 0.6;
}

section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    margin-top: 100px;
    opacity: 1;
    transform: none;
}

section.animate {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

section.animate:not(.animate-in) {
    opacity: 0;
    transform: translateY(50px);
}

#section1bodytext {
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.services-intro {
    max-width: 800px;
    margin: 0 auto 3rem;
    text-align: left;
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.8;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 2rem;
    padding: 0;
    list-style: none;
    max-width: 1000px;
    margin: 0 auto;
}

.service-item {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: var(--accent-color);
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
    perspective: 1000px;
}

#section2.animate-in .service-item {
    transform: translateX(0);
    opacity: 1;
}

#section2.animate-in .service-item:nth-child(1) { transition-delay: 0.1s; }
#section2.animate-in .service-item:nth-child(2) { transition-delay: 0.2s; }
#section2.animate-in .service-item:nth-child(3) { transition-delay: 0.3s; }
#section2.animate-in .service-item:nth-child(4) { transition-delay: 0.4s; }
#section2.animate-in .service-item:nth-child(5) { transition-delay: 0.5s; }
#section2.animate-in .service-item:nth-child(6) { transition-delay: 0.6s; }

.card-inner {
    position: relative;
    width: 100%;
    height: auto;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.service-item.flipped .card-inner {
    transform: rotateY(180deg);
}

.front,
.back {
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
}

.front {
    position: relative;
    background: var(--accent-color);
}

.back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotateY(180deg);
    background: var(--accent-color);
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.front img,
.service-item img {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.front .service-text,
.service-item .service-text {
    flex: 1;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    line-height: 1.4;
}

.service-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.service-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 119, 182, 0.15);
}

.service-item:hover .front img,
.service-item:hover img {
    transform: scale(1.05);
}

.service-item:hover::before {
    left: 100%;
}

.service-item.active {
    background: linear-gradient(135deg, var(--primary-color), #005A9E);
    color: #FFFFFF;
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 119, 182, 0.3);
}

.service-item.active .service-text {
    color: #FFFFFF;
}

.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.services-details {
    position: fixed;
    z-index: 1001;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--accent-color);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.services-details.active {
    display: block;
}

.back-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 119, 182, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.8rem 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 44px;
    min-height: 44px;
}

.back-btn:hover {
    background: var(--primary-color);
    color: #FFFFFF;
    transform: scale(1.1);
}

.detail-panel {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease-out;
}

.detail-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.service-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-color);
    text-align: left;
}

.service-content p {
    margin-bottom: 1rem;
    font-weight: 400;
}

.service-content ul {
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
}

.service-content ul li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    font-weight: 400;
}

.service-content ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1rem;
}

.scroll-container {
    overflow-x: scroll;
    overflow-y: hidden;
    position: relative;
    width: 100%;
    padding: 2rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

.scroll-content {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2rem;
    width: max-content;
    user-select: none;
}

.logo-wrapper {
    width: 150px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    user-select: none;
}

.scroll-content img {
    max-width: 100%;
    max-height: 80px;
    width: auto;
    height: auto;
    pointer-events: none;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
    -webkit-user-drag: none;
}

.logo-wrapper:hover img {
    filter: grayscale(0%);
}

.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem auto;
    max-width: 1000px;
}

.client-card {
    background-color: var(--accent-color);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.client-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.client-card img {
    max-width: 120px;
    max-height: 80px;
    width: auto;
    height: auto;
    transition: filter 0.3s ease;
    margin-bottom: 1rem;
}

.client-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.client-card ul {
    list-style: none;
    text-align: left;
    font-size: 0.95rem;
    color: var(--text-color);
}

.client-card ul li {
    margin-bottom: 0.25rem;
    padding-left: 1rem;
    position: relative;
}

.client-card ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2em;
}

#section4 form {
    max-width: 500px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#section4 form input[type="text"],
#section4 form input[type="email"],
#section4 form textarea {
    padding: 0.75rem;
    border: 1px solid #CCCCCC;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#section4 form textarea {
    resize: none;
    height: 150px;
}

.submit-btn {
    background-color: var(--primary-color);
    color: #FFFFFF;
    border: 1px solid var(--primary-color);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: color 0.35s ease;
    overflow: hidden;
    cursor: pointer;
    width: 100%;
    position: relative;
    z-index: 1;
}

.submit-btn::after {
    content: '';
    background: var(--accent-color);
    position: absolute;
    z-index: -1;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    transition: width 0.35s ease;
}

.submit-btn:hover {
    color: var(--primary-color);
}

.submit-btn:hover::after {
    width: 100%;
}

.form-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin: 1rem 0;
    font-weight: 500;
    border: 1px solid transparent;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

.form-message.success {
    background-color: rgba(34, 197, 94, 0.12);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.4);
}

.form-message.error {
    background-color: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border-color: rgba(248, 113, 113, 0.4);
}

.form-message::before {
    content: '!';
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.form-message.success::before {
    content: '✓';
    color: #16a34a;
}

.form-message.error::before {
    color: #dc2626;
}

.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    min-width: 280px;
    max-width: 360px;
    background: var(--accent-color);
    color: var(--text-color);
    padding: 1rem 1.25rem;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    border-left: 4px solid var(--primary-color);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    pointer-events: auto;
}

.toast--visible {
    transform: translateX(0);
    opacity: 1;
}

.toast--hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 0.1rem;
    color: var(--primary-color);
}

.toast-text {
    flex: 1;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin-left: 0.5rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.toast-close:hover,
.toast-close:focus {
    opacity: 1;
}

.toast--success {
    border-left-color: #16a34a;
}

.toast--success .toast-icon {
    color: #16a34a;
}

.toast--error {
    border-left-color: #dc2626;
}

.toast--error .toast-icon {
    color: #dc2626;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#other-pages {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    background-color: var(--primary-color);
    color: var(--accent-color);
}

.footerlinks_1 a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.footerlinks_1 a:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--accent-color);
    border-top: 2px solid var(--primary-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem 2rem;
    z-index: 999;
    display: none;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
}

.cookie-banner.show {
    display: block;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-text {
    flex: 1;
    text-align: left;
}

.cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-end;
    align-items: center;
}

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    display: inline-block;
}

.accept-btn {
    background-color: var(--primary-color);
    color: var(--accent-color);
}

.accept-btn:hover {
    background-color: #005A9E;
}

.reject-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.reject-btn:hover {
    background-color: var(--primary-color);
    color: var(--accent-color);
}

.more-info-link {
    color: var(--grey-color);
    font-size: 0.9rem;
    text-decoration: underline;
}

.more-info-link:hover {
    color: var(--primary-color);
}

.page-wrapper {
    padding: 4rem 2rem;
    margin-top: 120px;
    border-bottom: none;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--accent-color);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 3rem;
    text-align: left;
}

.container.narrow {
    max-width: 800px;
}

.imprint-figure {
    margin: 2rem auto 0;
    max-width: 100%;
    text-align: center;
}

.imprint-figure img {
    display: inline-block;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.18);
}

.imprint-text {
    margin-top: 2.5rem;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.imprint-text h2,
.imprint-text h3 {
    color: var(--primary-color);
}

.imprint-text h2 {
    margin-bottom: 1.5rem;
}

.imprint-text h3 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.imprint-text p:last-of-type {
    margin-bottom: 0;
}

.page-wrapper h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    text-align: center;
}

.page-wrapper h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.page-wrapper h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.page-wrapper p,
.page-wrapper ul,
.page-wrapper li {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.page-wrapper ul {
    padding-left: 1.5rem;
}

.contact-info {
    background-color: var(--accent-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    header {
        padding: 0.75rem 1rem;
    }

    header img {
        max-width: 150px;
    }

    .button-container {
        display: none;
        flex-direction: column;
        align-items: center;
        background-color: var(--accent-color);
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        padding: 1rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }

    .button-container.active {
        display: flex;
    }

    .section-link {
        width: 100%;
        text-align: center;
        padding: 1rem;
        border-bottom: 1px solid #e5e7eb;
    }

    .section-link:hover::after {
        width: 20px;
    }

    .kontakt-link {
        width: 100%;
        text-align: center;
        padding: 1rem;
        border-bottom: none;
        margin-top: 0.5rem;
        overflow: hidden;
    }

    .hamburger {
        display: block;
        position: relative;
    }

    section {
        padding: 2rem 1rem;
        margin-top: 80px;
    }

    h2 {
        font-size: 1.5rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .service-item {
        transform: none;
    }

    .service-item:hover {
        transform: translateY(-4px);
    }

    .front .service-text,
    .service-item .service-text {
        font-size: 0.85rem;
        padding: 0.8rem;
    }

    .front img,
    .service-item img {
        max-height: 120px;
    }

    .services-details {
        width: 95%;
        max-height: 90vh;
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .back-btn {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.6rem;
        font-size: 1.5rem;
        min-width: 40px;
        min-height: 40px;
    }

    .service-content {
        font-size: 0.95rem;
    }

    .client-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .client-card {
        padding: 1rem;
    }

    .client-card img {
        max-width: 100px;
    }

    .cookie-banner {
        padding: 1rem;
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }

    .cookie-btn {
        width: 100%;
        max-width: 200px;
    }

    .more-info-link {
        order: -1;
        margin-bottom: 0.5rem;
    }

    .container {
        padding: 2rem 1.5rem;
    }

    .page-wrapper {
        padding: 2rem 1rem;
    }
}
