/* --- Variables & Reset --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    /* Primary: Trust & Elegance */
    --primary-color: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    --primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);

    /* Secondary: Clean Slate */
    --secondary-color: #475569;
    --secondary-light: #94a3b8;
    --text-dark: #0f172a;

    /* Backgrounds & UI */
    --bg-body: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.95);
    --border-color: rgba(226, 232, 240, 0.8);

    /* Action (Calm Emerald & Danger Red) */
    --action-success: #059669;
    --action-success-bg: #ecfdf5;
    --action-danger: #dc2626;
    --action-danger-light-bg: rgba(220, 38, 38, 0.1);

    /* Fancy UI Helpers */
    --white: #ffffff;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 40px -10px rgba(2, 132, 199, 0.15);
    --glass-blur: blur(12px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background-color: var(--bg-body);
    color: var(--secondary-color);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

main {
    flex: 1;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* =========================================
   TOP NAVIGATION BAR (Homepage)
   ========================================= */

header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
    position: relative;
    /* Desktop positioning context */
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    max-height: 75px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    margin: -15px;
}

.logo img:hover {
    transform: scale(1.02);
}

.nav-menu ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:not(.btn-login)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.nav-menu a:not(.btn-login):hover::after {
    width: 100%;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.btn-login {
    background: var(--primary-gradient);
    color: var(--white) !important;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    display: inline-block;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.3);
}

/* Hidden by default on desktop */
.menu-toggle {
    display: none;
}

.hamburger {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-dark);
    margin: 0;
}

/* =========================================
   MAIN CONTENT & FANCY UI
   ========================================= */

.hero-wrapper {
    position: relative;
    padding: 8rem 1rem 10rem;
    background: url('https://images.unsplash.com/photo-1519494026892-80bbd2d6fd0d?q=80&w=2000&auto=format&fit=crop') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: -85px;
    /* Pulls hero behind the transparent header */
    padding-top: calc(8rem + 85px);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(2, 132, 199, 0.75) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    color: var(--white);
    animation: fadeInUp 1s ease-out;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
}

.btn-primary {
    display: inline-block;
    background: var(--primary-gradient);
    color: var(--white);
    padding: 1.1rem 2.5rem;
    text-decoration: none;
    font-size: 1.1rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 10px 20px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 25px rgba(2, 132, 199, 0.4);
    color: var(--white);
}

/* Features Section */
.features {
    padding: 5rem 0;
    text-align: center;
    position: relative;
    z-index: 10;
    margin-top: -60px;
}

.feature-grid {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.feature-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    flex: 1;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

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

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: 50%;
    color: var(--primary-color);
}

.feature-card h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.feature-card p {
    color: var(--secondary-color);
    font-size: 0.95rem;
}

/* Contact Form */
.contact-section {
    background: var(--white);
    padding: 4rem;
    border-radius: var(--radius-lg);
    margin: 2rem auto 6rem;
    box-shadow: var(--shadow-soft);
    max-width: 800px;
    border: 1px solid var(--border-color);
}

.contact-header {
    text-align: center;
    margin-bottom: 3rem;
}

.contact-header h2 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.8rem;
    width: 100%;
}

.half-width {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background-color: var(--bg-body);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    background-color: var(--white);
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-submit-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 1.2rem;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    border: none;
}

.alert-success {
    background-color: var(--action-success-bg);
    color: var(--action-success);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    border: 1px solid #a7f3d0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Footer */
footer {
    background-color: #0f172a;
    color: var(--secondary-light);
    padding: 4rem 0 2rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-content h3 {
    color: var(--white);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.business-info,
.contact-info,
.legal-links {
    flex: 1;
    min-width: 200px;
}

.legal-links a {
    color: var(--secondary-light);
    text-decoration: none;
    display: block;
    margin-bottom: 0.8rem;
    transition: all 0.3s ease;
}

.legal-links a:hover {
    color: var(--white);
    transform: translateX(5px);
}

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   FORM VALIDATION UI
   ========================================= */

.is-valid {
    border-color: var(--action-success) !important;
    background-color: var(--white) !important;
}

.is-valid:focus {
    box-shadow: 0 0 0 4px var(--action-success-bg) !important;
}

.invalid-feedback {
    color: var(--action-danger);
    font-size: 0.85rem;
    margin-top: 0.4rem;
    display: block;
    font-weight: 500;
}

/* =========================================
   RESPONSIVE MEDIA QUERIES (FIXED)
   ========================================= */

@media (max-width: 991.98px) {
    .hero-content h1 {
        font-size: 2.8rem;
    }

    .feature-grid {
        flex-wrap: wrap;
    }

    .feature-card {
        min-width: 45%;
    }
}

@media (max-width: 768px) {

    /* Navbar Gap Fix - Detach from container width */
    .nav-bar {
        position: static;
    }

    .hamburger {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        padding: 1.5rem 0;
        border-top: 1px solid var(--border-color);
        z-index: 1001;
    }

    .menu-toggle:checked~.nav-menu {
        display: block;
        animation: fadeInUp 0.3s ease;
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        padding: 0;
        margin: 0;
    }

    .nav-menu ul li {
        width: 100%;
    }

    .btn-login {
        display: block;
        width: 80%;
        margin: 0 auto;
    }

    /* Fixed Layout & Overflow Alignments */
    .logo img {
        margin: -15px;
        max-height: 75px;
        /* Removes negative margin pushing layout on mobile */
    }

    .hero-wrapper {
        /* Restores dynamic calc padding so content doesn't get sucked behind the sticky header */
        padding: calc(5rem + 85px) 1rem 6rem;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .features {
        margin-top: -30px;
        padding: 3rem 0;
    }

    .feature-grid {
        flex-direction: column;
    }

    .feature-card {
        min-width: 100%;
        padding: 2.5rem 1.5rem;
        /* Slightly tighter padding for mobile screens */
    }

    .contact-section {
        padding: 2rem 1.5rem;
        margin: 2rem 0 4rem;
        /* Changed L/R margin from 1rem to 0 to align with wrapper */
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: left;
    }
}

/* Extra breakpoint for very small phones (e.g. iPhone SE) */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .contact-section {
        padding: 1.5rem 1rem;
    }

    .contact-header h2 {
        font-size: 1.8rem;
    }
}