html {
    scroll-behavior: smooth;
}

:root {
    /* Color Palette */
    --primary: #004d3d;
    --primary-light: #0d6b56;
    --secondary: #ff7d61;
    --accent: #f3f4ef;
    --text-dark: #1a1a1a;
    --text-light: #4a4a4a;
    --white: #ffffff;
    --error: #e74c3c;
    --success: #27ae60;

    /* Spacing */
    --section-padding: 100px 5%;
    --container-max-width: 1200px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[id] {
    scroll-margin-top: 100px;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-weight: 600;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Base Components */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    width: 100%;
}

.btn {
    display: inline-block;
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 77, 61, 0.2);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 125, 97, 0.2);
}

section {
    padding: var(--section-padding);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

/* Header */
header {
    width: 100%;
    position: fixed;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.header-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.mobile-nav-logo {
    display: none;
}

nav ul {
    display: flex;
    gap: 30px;
    align-items: center;
}

nav ul li a:hover {
    color: var(--primary);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 1001;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    background: url('assets/images/expat\ wills\ hero.webp') no-repeat center center/cover;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(255, 255, 255, 0.95) 40%,
            rgba(255, 255, 255, 0.4) 100%);
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23004d3d' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2v-4h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2v-4h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 2;
    opacity: 0.5;
}

.hero .container {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 60px;
    align-items: center;
}

.hero-content {
    max-width: 650px;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    color: var(--primary);
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.trust-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-light);
    opacity: 0.8;
}

.hero-form-container {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
    max-width: 550px;
    margin-left: auto;
}

.hero-form-container h3 {
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
    color: var(--primary);
}

.form-group {
    margin-bottom: 0px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    text-align: left;
}

.form-grid button {
    grid-column: 1 / -1;
    width: 100%;
    padding: 14px 20px;
    font-size: 0.95rem;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    color: var(--text-dark);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(0, 77, 61, 0.08);
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23004d3d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 48px;
    cursor: pointer;
}

.full-width {
    grid-column: 1 / -1;
}

.phone-group {
    display: flex;
    align-items: stretch;
    background-color: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.phone-group:focus-within {
    border-color: var(--primary);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(0, 77, 61, 0.08);
}

.country-code {
    flex: 0 0 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: var(--text-light);
    border-right: 1.5px solid #e2e8f0;
    background: rgba(0, 0, 0, 0.02);
    font-size: 0.95rem;
}

.phone-group input {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: 0;
}

.phone-group input:focus {
    box-shadow: none;
    background: transparent;
}

/* Services */
.services {
    background: var(--white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    padding: 40px;
    border-radius: 20px;
    background: var(--accent);
    transition: var(--transition);
    border: 1px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    background: var(--white);
    border-color: rgba(0, 77, 61, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 16px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.25rem;
}

/* Key Benefits Section */
.benefits {
    background-color: #fafafa;
    overflow: visible;
    padding: 120px 0 40px;
}

/* Modern Benefit Cards */
.benefits-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 20px 0 0;
}

.modern-card {
    background: #ffffff;
    border-radius: 40px;
    padding: 60px 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    overflow: hidden;
    position: sticky;
    margin-bottom: 25vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
}

.modern-card:nth-child(1) {
    top: 80px;
    z-index: 10;
    transform: scale(1);
}

.modern-card:nth-child(2) {
    top: 130px;
    z-index: 20;
    transform: scale(0.98);
}

.modern-card:nth-child(3) {
    top: 180px;
    z-index: 30;
    transform: scale(0.96);
}

.modern-card:nth-child(4) {
    top: 230px;
    z-index: 40;
    transform: scale(0.94);
}

.modern-card:nth-child(5) {
    top: 280px;
    z-index: 50;
    transform: scale(0.92);
}

.modern-card:last-child {
    margin-bottom: 0;
}

.modern-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    border-color: rgba(0, 77, 61, 0.05);
}

.modern-card .card-content {
    flex: 1;
    max-width: 500px;
}

.card-number {
    width: 45px;
    height: 45px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 35px;
    color: var(--text-dark);
}

.modern-card h3 {
    font-size: 2.0rem;
    margin-bottom: 25px;
    color: var(--primary);
    line-height: 1.1;
    letter-spacing: -1px;
}

.modern-card p {
    font-size: 1.25rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0;
}

.modern-card .card-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.visual-mockup {
    width: 100%;
    max-width: 450px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.modern-card:hover .visual-mockup {
    transform: rotate(-2deg) scale(1.05);
}

@media (max-width: 1024px) {
    .modern-card {
        flex-direction: column;
        padding: 50px;
        text-align: center;
    }

    .card-number {
        margin: 0 auto 30px;
    }

    .modern-card .card-content {
        max-width: 100%;
    }

    .modern-card h3 {
        font-size: 2rem;
    }
}

/* Process Section */
.process {
    background: var(--primary);
    background-image: radial-gradient(circle at 20% 30%, rgba(255, 125, 97, 0.05) 0%, transparent 40%);
    color: var(--white);
}

.process h2 {
    color: var(--white);
}

.process-timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding-left: 50px;
}

.process-timeline::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
}

.process-step {
    position: relative;
    margin-bottom: 60px;
}

.process-step::before {
    content: '';
    position: absolute;
    left: -44px;
    top: 5px;
    width: 30px;
    height: 30px;
    background: var(--secondary);
    border: 6px solid var(--primary);
    border-radius: 50%;
    z-index: 1;
}

.process-step h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.process-step p {
    color: rgba(255, 255, 255, 0.8);
}

/* FAQ */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid #e1e1e1;
    padding: 20px 0;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    padding: 15px 0;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-dark);
}

.faq-icon {
    font-size: 1.5rem;
    transition: var(--transition);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    color: var(--text-light);
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding-bottom: 20px;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

/* Enrollment Section */
.enrollment {
    background-color: var(--accent);
    text-align: center;
}

.enroll-card {
    background: var(--white);
    padding: 60px;
    border-radius: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.enroll-card .form-grid {
    margin: 30px 0;
}

/* Footer */
footer {
    background: var(--primary);
    color: var(--white);
    padding: 80px 5% 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 60px;
    margin-bottom: 60px;
}

.footer-col h4 {
    margin-bottom: 25px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links li {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.footer-links i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--secondary);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--white);
}

.disclaimer {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    line-height: 1.4;
}

/* Animations */
[data-animate] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 991px) {
    section {
        padding: 60px 5%;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2.5rem;
    }

    .mobile-menu-toggle {
        display: block;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--white);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        transition: var(--transition);
        padding: 40px;
        display: flex;
        flex-direction: column;
    }

    .mobile-nav-logo {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--primary);
        margin-bottom: 50px;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .mobile-nav-logo img {
        height: 32px;
        width: auto;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
    }

    nav ul li {
        width: 100%;
    }

    nav ul li a {
        font-size: 1.2rem;
        font-weight: 600;
        display: block;
        width: 100%;
    }

    /* Hero Responsive */
    .hero {
        padding-top: 120px;
        min-height: auto;
        background-attachment: scroll;
        /* Better for mobile performance */
    }

    .hero .container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero h1 {
        font-size: clamp(2rem, 8vw, 2.5rem);
        line-height: 1.1;
    }

    .hero p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
        margin-left: auto;
        margin-right: auto;
    }

    .trust-bar {
        justify-content: center;
        text-align: left;
    }

    .hero-form-container {
        max-width: 100%;
        margin: 0 auto;
        padding: 24px 16px;
        border-radius: 16px;
    }

    /* Services Responsive */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-card {
        padding: 30px;
    }

    /* Benefits Responsive */
    .benefits {
        padding: 80px 0 40px;
    }

    .benefits-grid {
        gap: 25px;
        padding: 0 15px;
    }

    .modern-card {
        padding: 40px 20px;
        flex-direction: column;
        text-align: center;
        gap: 25px;
        height: auto;
        position: static;
        margin-bottom: 0;
        transform: none !important;
        border-radius: 20px;
    }

    .modern-card h3 {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }

    .modern-card p {
        font-size: 1.1rem;
    }

    .card-visual {
        max-width: 100%;
        width: 100%;
    }

    .visual-mockup {
        max-width: 100%;
        border-radius: 12px;
        transform: none !important;
    }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .form-group label {
        font-weight: 600;
        margin-bottom: 6px;
        font-size: 0.85rem;
    }

    .phone-group .country-code {
        padding: 0 10px;
    }

    .header-container {
        padding: 15px 20px;
    }

    .logo {
        font-size: 1.3rem;
    }

    .logo img {
        height: 32px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    /* Process Timeline Responsive */
    .process-timeline {
        padding-left: 30px;
    }

    .process-step {
        margin-bottom: 40px;
    }

    .process-step::before {
        left: -37px;
        width: 22px;
        height: 22px;
        border-width: 4px;
        top: 4px;
    }

    .process-step h3 {
        font-size: 1.3rem;
    }

    /* FAQ Responsive */
    .faq-question {
        font-size: 1rem;
        padding: 12px 0;
    }

    /* Footer Responsive */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: left;
    }

    .footer-col .logo {
        justify-content: flex-start;
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .disclaimer {
        text-align: left;
        padding-top: 25px;
    }
}

@media (max-width: 540px) {
    .hero-form-container h3 {
        font-size: 1.25rem;
        margin-bottom: 1.2rem;
    }

    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    .phone-group .country-code {
        flex: 0 0 60px;
        font-size: 0.85rem;
    }
}

/* Highlight target elements */
:target {
    animation: target-pulse 1.5s ease-out;
}

@keyframes target-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 77, 61, 0.4);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 15px rgba(0, 77, 61, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 77, 61, 0);
    }
}