/* =========================================
   1. VARIABLES & THEME SETUP
   ========================================= */
:root {
    /* Color Palette - Light Mode (Default) */
    --bg-body: #ffffff;
    --bg-card: #f8f9fa;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --text-main: #1a1a1a;
    --text-muted: #666666;
    --primary: #2563eb;
    /* Royal Blue */
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --accent: #06b6d4;
    /* Cyan */
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Spacing & Layout */
    --container-width: 1200px;
    --header-height: 80px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease-in-out;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
    /* Color Palette - Dark Mode */
    --bg-body: #0f172a;
    /* Slate 900 */
    --bg-card: #1e293b;
    /* Slate 800 */
    --bg-glass: rgba(15, 23, 42, 0.9);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    /* Blue 500 */
    --primary-hover: #60a5fa;
    --secondary: #94a3b8;
    --accent: #22d3ee;
    /* Cyan 400 */
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* =========================================
   2. RESET & BASE STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: inherit;
}

body,
button,
input,
textarea,
select {
    font-family: var(--font-main);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   3. TYPOGRAPHY
   ========================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.75rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =========================================
   4. NAVIGATION
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all var(--transition-normal);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-left: auto;
}

.nav-item {
    position: relative;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
}

.nav-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::after {
    width: 100%;
}

.nav-item:hover {
    color: var(--primary);
}

.nav-item:hover::after {
    width: 100%;
}

.nav-item.header-actions::after {
    display: none;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    min-width: 220px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    padding: 0.5rem 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-main);
}

.dropdown-menu li a:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
    padding-left: 1.8rem;
}

.dropdown-menu li a.active {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
    font-weight: 600;
}

[data-theme="dark"] .dropdown-menu li a.active {
    background: rgba(255, 255, 255, 0.05);
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auth-buttons.stacked {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .auth-buttons.stacked {
        flex-direction: row;
        max-width: none;
        width: auto;
        justify-content: center;
        gap: 1.5rem;
    }
}

.auth-buttons.stacked .btn {
    width: 100%;
}

@media (min-width: 768px) {
    .auth-buttons.stacked .btn {
        width: auto;
        min-width: 180px;
    }
}

.btn {
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    font-size: 0.9rem;
    display: inline-block;
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.23);
}

.btn-auth {
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s ease;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1.5rem;
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
}

@media (min-width: 992px) {
    .theme-toggle {
        margin-right: 0;
    }
}

.theme-toggle:hover {
    transform: rotate(180deg);
    color: var(--accent);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

/* =========================================
   5. SECTIONS
   ========================================= */
section {
    padding: 100px 0;
}

@media (max-width: 1024px) {
    section {
        padding: 80px 0;
    }
}

@media (max-width: 768px) {
    section {
        padding: 70px 0;
    }
}

@media (max-width: 600px) {
    section {
        padding: 60px 0;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.hero .btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

/* Hero Section with BG Image Support */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Increased padding to account for fixed header + breathing room */
    padding-top: calc(var(--header-height) + 50px);
    padding-bottom: 50px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    /* Default fallback */
    background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.1), transparent 40%),
        radial-gradient(circle at bottom left, rgba(6, 182, 212, 0.1), transparent 40%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    /* Default Light Overlay */
    z-index: 1;
}

[data-theme="dark"] .hero-overlay {
    background: rgba(15, 23, 42, 0.9);
    /* Dark Overlay */
}

.hero .container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-content {
    max-width: 850px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin: 0.75rem 0 1.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-dark .section-subtitle {
    color: var(--accent) !important;
    opacity: 1;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    font-weight: 700;
    letter-spacing: 3px;
    background: rgba(0, 0, 0, 0.5);
    /* Darker background for subtitle pill */
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 2rem;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-dark h1 {
    color: #ffffff !important;
    font-weight: 800;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 2px 10px rgba(0, 0, 0, 0.7);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-dark .text-gradient {
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
}

.hero-dark p {
    color: #ffffff !important;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
    font-weight: 400;
    max-width: 800px;
    opacity: 0.9;
}

.hero-dark .hero-overlay {
    background: rgba(0, 0, 0, 0.75) !important;
}

/* Generic Image Cards */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.services-grid>* {
    flex: 1 1 300px;
    max-width: 380px;
}

@media (max-width: 400px) {
    .services-grid>* {
        flex: 1 1 280px;
    }
}

.card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card h3 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.card p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card>span:last-child {
    margin-top: auto;
    padding-top: 1rem;
    align-self: center;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-img-container {
    height: 180px;
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    background: #ccc;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img-container img {
    transform: scale(1.1);
}

/* Tech Stack Logos */
.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.tech-item-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 140px;
    height: 140px;
    justify-content: center;
    transition: all 0.3s ease;
}

.tech-item-logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.tech-item-logo:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

@media (max-width: 480px) {
    .tech-grid {
        gap: 1.5rem;
    }

    .tech-item-logo {
        width: 130px;
        height: 130px;
        padding: 1rem;
    }

    .tech-item-logo img {
        width: 50px;
        height: 50px;
    }
}

.tech-item-logo:hover img {
    transform: scale(1.1);
}

/* Service Detail Process Steps */
.process-grid {
    display: grid;
    gap: 4rem;
}

.process-step {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.process-step:nth-child(even) {
    flex-direction: row-reverse;
}

.process-img {
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.process-content {
    flex: 1;
}

.process-number {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.2;
    line-height: 1;
    margin-bottom: -1rem;
    display: block;
}

/* Filterable Gallery */
.gallery-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-muted);
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 10;
    box-shadow: var(--shadow-md);
    transition: all 0.5s ease;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.3s ease-in-out;
    text-align: center;
    padding: 2rem;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-overlay h3 {
    margin-bottom: 0.5rem;
    color: #fff;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.project-overlay p {
    color: #cbd5e1;
    margin-bottom: 1.5rem;
    transform: translateY(20px);
    transition: transform 0.3s ease 0.1s;
}

.project-card:hover .project-overlay h3,
.project-card:hover .project-overlay p {
    transform: translateY(0);
}

.btn-light-outline {
    border: 1px solid #fff;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-light-outline:hover {
    background: #fff;
    color: #000;
}

/* Team Member Cards */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.team-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
}

.team-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.team-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #ccc;
}

.team-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.team-info {
    padding: 1.5rem;
}

.team-role {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Timeline (Image Based) */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--border-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-card);
    border: 4px solid var(--primary);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
    transition: background-color 0.3s ease;
}

.timeline-item:hover::after {
    background-color: var(--primary);
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.right::after {
    left: -10px;
}

.timeline-content {
    padding: 0;
    /* Removing padding for img inside */
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.timeline-img {
    height: 150px;
    width: 100%;
    object-fit: cover;
}

.timeline-text {
    padding: 1.5rem;
}

.timeline-item:hover .timeline-content {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* CTA Section with BG Image */
.cta-section {
    position: relative;
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    border-top: none;
    border-bottom: none;
    overflow: hidden;
}

.cta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(37, 99, 235, 0.9);
    /* Brand Primary Overlay */
    z-index: 1;
}

.cta-section .container {
    position: relative;
    z-index: 2;
}

.cta-section h2,
.cta-section p {
    color: #fff !important;
}

.cta-section .btn-primary {
    background: #fff;
    color: var(--primary);
}

.cta-section .btn-primary:hover {
    background: #f8fafc;
    transform: translateY(-2px);
}

/* Contact Hero Section */
.contact-hero {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.contact-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    /* Dark overlay for readability */
    z-index: 1;
}

.contact-hero .hero-content {
    position: relative;
    z-index: 2;
}

.contact-hero .section-subtitle,
.contact-hero h1,
.contact-hero p {
    color: #fff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.contact-hero .text-gradient {
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Responsive adjustments for contact hero */
@media (max-width: 768px) {
    .contact-hero {
        background-position: center center;
        background-attachment: scroll;
        /* Better performance on mobile */
    }

    .contact-hero .hero-content {
        text-align: center;
    }

    .contact-hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .contact-hero h1 {
        font-size: 2rem;
    }

    .contact-hero .hero-content {
        padding: 0 1rem;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
    transition: all var(--transition-normal);
}

.input-group:focus-within i {
    color: var(--primary);
    transform: scale(1.1);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.input-group .form-control {
    padding-left: 2.8rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

/* Auth Pages Setup */
body.auth-page {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.auth-container {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.05), transparent 60%);
    box-sizing: border-box;
}

.auth-box {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    /* Hide scrollbar but allow functional scroll if content overflows card */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.auth-box::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    .auth-box {
        padding: 2rem;
    }

    .input-group i {
        font-size: 0.9rem;
        width: 0.9rem;
        height: 0.9rem;
        left: 0.9rem;
    }

    .input-group .form-control {
        padding-left: 2.6rem;
    }
}

@media (max-width: 480px) {
    .auth-box {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .auth-box h2 {
        font-size: 1.3rem !important;
        margin-bottom: 0.25rem !important;
    }

    .auth-box .logo {
        font-size: 1.25rem !important;
        margin-bottom: 0.25rem !important;
    }

    .input-group i {
        font-size: 0.85rem;
        width: 0.85rem;
        height: 0.85rem;
        left: 0.85rem;
    }

    .input-group .form-control {
        padding-left: 2.5rem;
        font-size: 0.9rem;
    }
}

/* =========================================
   6. FOOTER
   ========================================= */
.footer {
    background: var(--bg-card);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    font-size: 1rem;
}

.social-icon:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.footer-bottom {
    position: relative;
    border-top: 1px solid var(--border-color);
    padding-top: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.back-to-top {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 30px;
    right: 30px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 900;
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

/* =========================================
   7. ANIMATIONS
   ========================================= */
.animate-on-scroll {
    opacity: 0;
    will-change: transform, opacity;
}

.fade-up {
    transform: translateY(20px);
}

.fade-up.active {
    animation: fadeUp 0.8s ease-out forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    transform: translateX(-50px);
}

.slide-in-left.active {
    animation: slideInLeft 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-50px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.pop-up {
    transform: scale(0.95) translateY(30px);
}

.pop-up.active {
    animation: popUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popUp {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(30px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

/* =========================================
   8. SOCIAL LOGIN
   ========================================= */
.social-login-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.social-login-separator::before,
.social-login-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.social-login-separator::before {
    margin-right: .5em;
}

.social-login-separator::after {
    margin-left: .5em;
}

.social-login-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap !important;
    /* Force single row */
    width: 100%;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    white-space: nowrap !important;
    /* Prevent text wrap */
    min-width: 0;
    height: 48px;
    /* Fixed height for consistency */
    border-radius: 999px;
    /* Pill shape */
    padding: 0 1rem;
    box-sizing: border-box;
    cursor: pointer;
}

.social-btn svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.btn-google {
    background: #fff;
    color: #374151;
    border: 1px solid var(--border-color);
}

.btn-google:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .btn-google {
    background: var(--bg-card);
    color: var(--text-main);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-google:hover {
    background: var(--bg-body);
}

.btn-facebook {
    background: #1877F2;
    color: #fff;
    border: 1px solid #1877F2;
}

.btn-facebook:hover {
    background: #166fe5;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(24, 119, 242, 0.25);
}

/* =========================================
   10. PROCESS STEPS
   ========================================= */
.process-grid {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.process-step {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.process-step:nth-child(even) {
    direction: rtl;
}

.process-step:nth-child(even)>* {
    direction: ltr;
}

.process-img {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.process-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.number-container {
    display: flex;
    align-items: flex-start;
}

.process-number {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.2;
    line-height: 1;
}

/* =========================================
   9. RESPONSIVE
   ========================================= */
@media (max-width: 991px) {
    .navbar .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: var(--bg-glass);
        backdrop-filter: blur(15px);
        padding: 2rem 1.5rem;
        z-index: 999;
        overflow-y: auto;
        transform: translateY(-20px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        align-items: center;
        text-align: center;
        justify-content: flex-start;
        gap: 0;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        pointer-events: none;
    }

    .navbar .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .navbar .nav-links .nav-item {
        width: 100%;
        padding: 1.25rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        display: block;
        margin: 0;
    }

    [data-theme="dark"] .navbar .nav-links .nav-item {
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }

    .navbar .nav-links .nav-item:last-of-type {
        border-bottom: none;
    }

    .navbar .nav-links .nav-item.dropdown.active .dropdown-menu {
        display: block;
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(0, 0, 0, 0.03);
        border: none;
        box-shadow: none;
        padding: 0.5rem 0;
        margin-top: 1rem;
        border-radius: 12px;
    }

    [data-theme="dark"] .navbar .nav-links .nav-item.dropdown.active .dropdown-menu {
        background: rgba(255, 255, 255, 0.03);
    }

    .navbar .nav-links .nav-item.active::after {
        display: none;
    }

    .navbar .nav-links .nav-item.dropdown.active>a i {
        transform: rotate(180deg);
    }

    .navbar .nav-links .dropdown-menu li a {
        padding: 1rem;
        font-size: 0.95rem;
        color: var(--text-muted);
        display: block;
        border-radius: 8px;
    }

    .navbar .nav-links .dropdown-menu li a.active {
        color: var(--primary);
        background: rgba(0, 0, 0, 0.05);
        font-weight: 600;
    }

    [data-theme="dark"] .navbar .nav-links .dropdown-menu li a.active {
        background: rgba(255, 255, 255, 0.05);
    }

    .mobile-menu-btn {
        display: block;
        z-index: 1001;
    }

    .header-actions {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 1rem;
        width: 100%;
        max-width: 400px;
        margin: 2rem auto 0;
        padding-top: 2rem;
        border-top: 1px solid var(--border-color);
        align-items: center;
        justify-content: center;
    }

    .header-actions .btn {
        flex: 1;
        min-width: 110px;
        max-width: 180px;
        text-align: center;
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        border-radius: 10px;
    }

    .navbar-right {
        order: 2;
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .navbar .logo {
        order: 1;
    }

    .header-actions .theme-toggle {
        display: none !important;
    }

    .navbar .nav-links .header-actions {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .navbar-right .theme-toggle {
        display: flex;
        font-size: 1.25rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .process-step,
    .process-step:nth-child(even) {
        grid-template-columns: 1fr;
        direction: ltr;
        text-align: center;
    }

    .number-container {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    section {
        padding: 60px 0;
    }

    .hero-content {
        text-align: center;
        margin: 0 auto;
    }


    .footer-grid {
        grid-template-columns: 1fr;
    }

    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item::after {
        left: 21px;
    }

    .left::after,
    .right::after {
        left: 21px;
    }

    .right {
        left: 0%;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-bottom .social-links {
        position: static;
    }

    .auth-box {
        padding: 2rem;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .container {
        padding: 0 15px;
    }

    .btn {
        width: initial;
        text-align: center;
    }

    .header-actions .btn {
        width: 100%;
        max-width: 100%;
        min-width: unset;
    }

    .timeline-item {
        padding-left: 50px;
    }

    .timeline::after {
        left: 20px;
    }

    .timeline-item::after,
    .left::after,
    .right::after {
        left: 10px;
    }

    .social-login-buttons {
        flex-wrap: nowrap !important;
        /* Reinforce side-by-side */
        gap: 0.75rem;
    }

    .social-btn {
        font-size: 0.85rem;
        padding: 0 0.5rem;
        height: 48px;
        /* Maintain height */
    }

    .social-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* =========================================
   11. RESPONSIVE GRID UTILITIES
   ========================================= */
.split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 991px) {
    .split-grid {
        grid-template-columns: 1fr !important;
        gap: 3rem;
        text-align: center !important;
    }

    .split-grid>div {
        text-align: center !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    /* Reverse order to put image on top when text is first in HTML */
    .split-grid.reverse-mobile>div:first-child {
        order: 2;
    }

    .split-grid.reverse-mobile>div:last-child {
        order: 1;
    }

    .split-grid img {
        max-width: 100%;
        width: 100%;
        height: auto;
        margin-bottom: 0;
    }

    .split-grid .section-subtitle,
    .split-grid .section-title,
    .split-grid p {
        text-align: center !important;
    }
}

@media (max-width: 400px) {
    .split-grid {
        gap: 2rem;
    }
}

@media (max-width: 991px) {
    .hero {
        padding-top: calc(var(--header-height) + 60px);
        padding-bottom: 60px;
        min-height: 60vh;
    }
}

@media (max-width: 600px) {
    .hero {
        padding-top: calc(var(--header-height) + 40px);
        padding-bottom: 40px;
        min-height: 50vh;
    }
}

/* =========================================
   12. ABOUT PAGE ADJUSTMENTS
   ========================================= */

/* Desktop defaults */
.about-intro-img {
    border-radius: 16px;
    overflow: hidden;
    height: 450px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
    width: 100%;
}

.about-intro-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mission-vision-img {
    height: 300px;
    overflow: hidden;
    width: 100%;
}

.mission-vision-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tablet & Mobile (991px and below) */
@media (max-width: 991px) {

    /* Reset fixed heights and allow natural scaling */
    .about-intro-img,
    .mission-vision-img {
        height: auto !important;
        min-height: auto !important;
        aspect-ratio: auto !important;
    }

    /* Ensure full visibility without cropping */
    .about-intro-img img,
    .mission-vision-img img {
        width: 100%;
        height: auto !important;
        object-fit: contain !important;
        /* Ensure image is not zoomed or cropped */
    }

    /* Fix timeline images cropping */
    .timeline-img {
        height: auto !important;
        width: 100%;
        object-fit: contain !important;
        aspect-ratio: auto !important;
    }
}

/* =========================================
   13. PARTNER IMAGES (ABOUT PAGE)
   ========================================= */
.partner-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.partner-img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Ensure responsiveness for partner images */
@media (max-width: 991px) {
    .partner-img {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 480px) {
    .partner-img {
        width: 130px;
        height: 130px;
    }
}