/* Hero title spacing for all languages */
.hero-title {
    margin-top: 2.5rem;
}

/* Contact form grid and field styling */
.cf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.cf-field {
    margin-bottom: 1rem;
}
.cf-input {
    width: 100%;
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 1rem;
    font-family: var(--font);
    box-sizing: border-box;
}
.cf-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(27, 77, 91, 0.1);
}
:root {
    --brand: rgb(27, 77, 91);
    --brand-dark: rgb(18, 50, 61);
    --brand-light: rgb(233, 245, 247);
    --font: Roboto, Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    color: var(--brand-dark);
    background: #f6f7f8;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(27, 77, 91, 0.95);
    backdrop-filter: blur(6px);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 1000;
}

nav .brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

nav .brand img.logo {
    height: 38px;
    display: block;
}
nav .brand .brand-text {
    display: inline-block;
    margin-left: 0.6rem;
    font-size: 1.2rem;
    vertical-align: middle;
}

nav .links a {
    color: white;
    text-decoration: none;
    margin-left: 1.25rem;
    font-weight: 400;
    transition: 0.2s ease;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

nav .links a:hover { opacity: 0.7; }

nav .links a.active {
    background: white;
    color: var(--brand);
    opacity: 1;
}

nav .links a.portal-link {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
}

nav .links a.portal-link:hover {
    background: white;
    color: var(--brand);
    opacity: 1;
}

.nav-spacer {
    flex: 1;
    order: 2; /* keep spacer after brand on large screens */
}

/* Desktop/tablet visual ordering: links first, then language selector. */
nav .links {
    order: 3;
}

nav .lang-dropdown {
    order: 4;
}

/* Hamburger remains hidden on larger viewports but keep an order slot
   so mobile media queries can override it cleanly. */
.hamburger {
    order: 5;
}


/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.4rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}


.lang-switch { margin-left: 2rem; cursor: pointer; font-weight: 500; }

/* flag icons for language selection */
.lang-flag {
    width: 26px;
    height: 18px;
    object-fit: cover;
    margin-left: 0.75rem;
    cursor: pointer;
    border-radius: 3px;
    vertical-align: middle;
    transition: opacity 0.15s ease;
}
.lang-flag:hover { opacity: 0.85; }

.section {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    padding: 4rem 0;
    min-height: auto;
    animation: fadeUp 0.7s ease both;
    text-align: center;
}

#home {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

#home {
    text-align: center;
}

#home h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); margin-bottom: 3rem; }

#home p {
    max-width: 750px;
    margin: 0 auto 2rem auto;
    font-size: 1.25rem;
    color: #345;
    line-height: 1.8rem;
}

.cta {
    background: var(--brand);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s ease;
}
.cta:hover { background: var(--brand-dark); }

#about p, #about .extra-text {
    max-width: 900px;
    font-size: 1.1rem;
    line-height: 1.8rem;
    margin-top: 1rem;
    color: #345;
    margin-left: auto;
    margin-right: auto;
}

#services .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.07);
    transition: 0.3s ease;
    text-align: left;
}
.service-card:hover { transform: translateY(-8px); box-shadow: 0 15px 35px rgba(0,0,0,0.1); }
.service-card h3 { margin-bottom: 0.5rem; }
.service-card p { color: #456; line-height: 1.6rem; }

#contact p { font-size: 1.15rem; margin: 0.7rem 0; }
#contact h1 { margin-bottom: 3rem; }

.contact-wrapper { max-width: 900px; margin: 0 auto; }

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.contact-info {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.07);
    text-align: left;
}

.contact-info h3 { margin-bottom: 1rem; color: var(--brand); }
.contact-info p { margin: 0.5rem 0; line-height: 1.6rem; }
.contact-info a { color: var(--brand); text-decoration: none; }
.contact-info a:hover { text-decoration: underline; }

.contact-form-wrapper {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.07);
    margin-top: 2rem;
    text-align: left;
}

.contact-form label { display: block; margin-bottom: 0.3rem; font-weight: 500; }
.contact-form input, .contact-form textarea {
    font-family: var(--font);
    font-size: 1rem;
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(27, 77, 91, 0.1);
}

.contact-form input[style*="borderColor"], .contact-form textarea[style*="borderColor"] {
    border-color: #ddd;
    transition: border-color 0.2s ease;
}

.field-error {
    color: #d32f2f;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    display: none;
    font-weight: 500;
}

.cf-status { min-height: 1.2rem; font-weight: 500; }

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transform: translateX(120%);
    transition: transform 0.4s ease;
    max-width: 380px;
}
.toast.show { transform: translateX(0); }
.toast.success { background: #2e7d32; }
.toast.error { background: #d32f2f; }

/* Mobile Responsive Design */
@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        padding: 1.2rem 1rem;
    }

    .nav-spacer {
        order: 2;
        flex: 1;
    }

    nav .lang-dropdown {
        order: 3;
        margin: 0 0.5rem;
    }

    .hamburger {
        display: flex;
        order: 4;
    }

    nav .brand img.logo {
        height: 32px;
    }

    nav .links {
        order: 5;
        width: 100%;
        display: none;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0.8rem;
        background: rgba(27, 77, 91, 0.98);
        padding: 1rem;
        border-radius: 6px;
    }

    nav .links.active {
        display: flex;
    }

    nav .links a {
        margin-left: 0;
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
        width: 100%;
        display: block;
    }

    .section {
        width: 95%;
        padding: 2rem 0;
    }

    #home h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); margin-bottom: 1.5rem; }

    #home p {
        max-width: 100%;
        font-size: 1rem;
    }

    #about p, #about .extra-text {
        font-size: 1rem;
        margin-top: 0.8rem;
    }

    #services .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-form-wrapper {
        padding: 1.5rem;
    }

    .contact-form input, .contact-form textarea {
        font-size: 16px;
    }

    .contact-form > div[style*="display:grid"] {
        display: block !important;
    }

    .contact-form > div[style*="display:grid"] > div {
        margin-bottom: 1rem;
    }


    .cta {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    footer {
        padding: 1.5rem;
        margin-top: 2rem;
    }

    .lang-list {
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 1rem 0.8rem;
    }

    .hamburger {
        display: flex;
    }

    .hamburger span {
        width: 22px;
        height: 2.5px;
    }

    nav .brand {
        font-size: 1.2rem;
        order: 1;
    }

    nav .brand img.logo {
        height: 28px;
    }

    .nav-spacer {
        order: 2;
    }

    nav .lang-dropdown {
        order: 3;
        margin: 0 0.3rem;
    }

    .hamburger {
        order: 4;
        padding: 0.3rem;
    }

    nav .links {
        order: 5;
        gap: 0.3rem;
        padding: 0.8rem;
        margin-top: 0.5rem;
    }

    nav .links a {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        margin-left: 0;
    }

    .section {
        width: 100%;
        padding: 1.5rem 1rem;
    }

    #home h1 { font-size: clamp(1.2rem, 3vw, 1.8rem); margin-bottom: 1rem; }

    #home p {
        font-size: 0.9rem;
        line-height: 1.5rem;
    }

    #about p, #about .extra-text {
        font-size: 0.95rem;
        line-height: 1.5rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .service-card h3 { font-size: 1rem; }
    .service-card p { font-size: 0.9rem; }

    .contact-info {
        padding: 1rem;
    }

    .contact-info h3 { font-size: 1rem; margin-bottom: 0.7rem; }
    .contact-info p { font-size: 0.9rem; margin: 0.4rem 0; }

    .contact-form-wrapper {
        padding: 1rem;
        margin-top: 1.5rem;
    }

    .contact-form-wrapper h3 { font-size: 1.1rem; }

    .contact-form label { font-size: 0.9rem; }

    .contact-form input, .contact-form textarea {
        padding: 0.5rem;
        font-size: 16px;
    }

    .field-error { font-size: 0.75rem; }

    .cta {
        padding: 0.7rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .lang-list {
        min-width: 130px;
        top: calc(100% + 4px);
    }

    .lang-list li { padding: 6px 8px; font-size: 0.85rem; }
}



/* dropdown for language selector */
.lang-dropdown { display: inline-block; position: relative; margin-left: 0.5rem; }
.lang-dropdown button.lang-switch { background: transparent; border: none; padding: 0; display: inline-flex; align-items: center; cursor: pointer; color: inherit; }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); background: white; color: var(--brand-dark); border-radius: 6px; box-shadow: 0 8px 20px rgba(0,0,0,0.12); list-style: none; padding: 6px; margin: 0; min-width: 160px; z-index: 1500; }
.lang-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px; cursor: pointer; font-size: 0.95rem; }
.lang-list li:hover { background: #f3f6f7; }
.lang-list img.lang-flag { width: 22px; height: 14px; border-radius: 3px; }

.contact-extended h3 { margin-top: 0.6rem; }
.contact-extended ul { margin-left: 1rem; }


/* Footer styles */
footer {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: white;
    padding: 2.25rem 0 1rem 0;
}

.footer-inner {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
    padding-bottom: 0.75rem;
}

.footer-logo { height: 36px; display: block; margin-bottom: 0.6rem; }
.footer-brand p { color: rgba(255,255,255,0.85); font-size: 0.95rem; }

.footer-links h4, .footer-contact h4, .footer-social h4 { color: #f3fbfc; margin-bottom: 0.5rem; font-size: 1rem; }
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.4rem; }
.footer-links a { color: rgba(255,255,255,0.9); text-decoration: none; transition: opacity 0.15s ease; }
.footer-links a:hover { opacity: 0.8; text-decoration: underline; }

.footer-contact p { margin: 0.25rem 0; color: rgba(255,255,255,0.9); }
.footer-contact a { color: rgba(255,255,255,0.95); text-decoration: none; }

.social-icons { display:flex; gap:0.5rem; }
.social { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:50%; background:rgba(255,255,255,0.12); color:white; text-decoration:none; font-weight:600; }
.social:hover { background: rgba(255,255,255,0.2); }

.footer-bottom { text-align:center; color: rgba(255,255,255,0.75); font-size:0.9rem; margin-top: 0.75rem; }

@media (max-width: 900px) {
    .footer-inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .footer-inner { grid-template-columns: 1fr; text-align: center; gap: 1rem; }
    .footer-brand, .footer-links, .footer-contact, .footer-social { justify-self: center; }
    .footer-links ul { display: inline-block; }
}
