/* Abogadomex Custom Styles */

:root {
    --primary-color: #1B2A43;
    --secondary-color: #B29067;
    --primary-hover: #152238;
    --primary-light: #2A3B5C;
    --secondary-light: #C4A47B;
    --warning-color: #ffc107;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --bs-primary: #1B2A43;
    --bs-primary-rgb: 27, 42, 67;
}

/* Prevent layout shifts from all images */
img {
    height: auto;
    max-width: 100%;
}

/* Ensure images with explicit dimensions maintain aspect ratio */
img[width][height] {
    height: auto;
}

/* Reserve space for lazy-loaded images */
img[loading="lazy"] {
    content-visibility: auto;
}

/* Icon styles managed in homepage.html inline CSS for better CLS */

/* Logo Styles */
.logo {
    height: 32px;
    width: auto;
    transition: all 0.3s ease;
}

.logo-navbar {
    height: 28px;
    filter: brightness(0) invert(1); /* White logo for dark navbar */
}

.logo-light {
    filter: brightness(0) saturate(100%) invert(13%) sepia(18%) saturate(1347%) hue-rotate(202deg) brightness(95%) contrast(95%);
    /* Dark logo for light backgrounds */
}

.logo-dark {
    filter: brightness(0) invert(1); /* White logo for dark backgrounds */
}

.logo-favicon {
    width: 16px;
    height: 16px;
}

/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    padding-top: 76px; /* Space for fixed navbar */
}

/* Hero Section - Styles moved to homepage.html for better control */

/* Search Form */
.search-container {
    display: flex;
    gap: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    overflow: visible;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 100;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    min-width: 0;
}

.search-icon {
    position: absolute;
    left: 16px;
    z-index: 2;
    pointer-events: none;
}

.search-input {
    width: 100%;
    border: none;
    padding: 16px 16px 16px 48px;
    font-size: 16px;
    background: transparent;
    outline: none;
}

.search-input::placeholder {
    color: #9ca3af;
}

.state-dropdown-wrapper {
    position: relative;
    border-left: 1px solid #e5e7eb;
    z-index: 110;
}

.state-dropdown-wrapper .dropdown {
    position: relative;
    z-index: 111;
}

/* Forcer la direction du dropdown vers le bas */
.state-dropdown-wrapper .dropdown[data-bs-popper] {
    position: static !important;
}

.state-dropdown-wrapper .dropdown .dropdown-menu[data-bs-popper] {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    margin: 2px 0 0 0 !important;
}

.state-dropdown-btn {
    background: white;
    border: none;
    color: #374151;
    font-size: 16px;
    padding: 16px;
    border-radius: 0;
    width: 100%;
    text-align: left;
    min-width: 180px;
}

.state-dropdown-btn:hover,
.state-dropdown-btn:focus {
    background-color: #f9fafb;
    color: #374151;
    box-shadow: none;
    border: none;
}

.state-dropdown-btn:focus {
    outline: none;
}

.state-dropdown-menu {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 120 !important;
    position: absolute !important;
    top: 100% !important;
    bottom: auto !important;
    left: 0 !important;
    right: 0 !important;
    margin-top: 2px !important;
    margin-bottom: 0 !important;
    background: white !important;
    transform: none !important;
}

.state-dropdown-menu .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #374151;
}

.state-dropdown-menu .dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

.search-btn {
    background-color: var(--primary-color);
    border: none;
    color: white;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.search-btn:hover {
    background-color: var(--primary-hover);
}

.search-btn:active {
    transform: scale(0.98);
}

/* Cards */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

/* Law Firm Cards */
.law-firm-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(27, 42, 67, 0.25) !important;
}

.avatar-circle {
    font-size: 2rem;
    transition: transform 0.2s ease-in-out;
}

.card:hover .avatar-circle {
    transform: scale(1.1);
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.navbar-nav .nav-link:hover {
    color: var(--secondary-color) !important;
}

/* Buttons */
.btn {
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Registration button with high contrast design */
.navbar .btn-outline-warning {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light)) !important;
    border: 2px solid var(--secondary-color) !important;
    color: white !important;
    font-weight: 600 !important;
    align-self: center;
    margin-top: 0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(178, 144, 103, 0.4) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    border-radius: 25px !important;
    padding: 8px 16px !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease !important;
}

.navbar .btn-outline-warning::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.navbar .btn-outline-warning:hover::before {
    left: 100%;
}

.navbar .btn-outline-warning:hover {
    background: linear-gradient(135deg, #9e7c56, #8a6b49) !important;
    border-color: #9e7c56 !important;
    color: white !important;
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 4px 15px rgba(178, 144, 103, 0.5) !important;
}

.navbar .btn-outline-warning:active {
    transform: translateY(0) scale(1) !important;
    box-shadow: 0 2px 8px rgba(178, 144, 103, 0.4) !important;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

footer a:hover {
    color: var(--secondary-color) !important;
    transition: color 0.2s ease-in-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    /* Hero section styles moved to homepage.html for better control */
    
    .display-3 {
        font-size: 2.5rem;
    }
    
    /* Mobile Search Form */
    .search-container {
        flex-direction: column;
        border-radius: 8px;
        gap: 1px;
        background: #f3f4f6;
    }
    
    .search-input-wrapper {
        border-radius: 8px 8px 0 0;
        background: white;
    }
    
    .search-input {
        padding: 14px 14px 14px 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .search-icon {
        left: 14px;
    }
    
    .state-dropdown-wrapper {
        border-left: none;
        border-top: 1px solid #e5e7eb;
        background: white;
    }
    
    .state-dropdown {
        min-width: auto;
        width: 100%;
    }
    
    .dropdown-header {
        padding: 14px 16px;
    }
    
    .dropdown-text {
        font-size: 16px;
    }
    
    .dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
        margin: 0;
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15);
    }
    
    .dropdown-options {
        max-height: calc(70vh - 80px);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .search-btn {
        border-radius: 0 0 8px 8px;
        padding: 16px;
        font-size: 16px;
        font-weight: 600;
    }
    
    .search-btn span {
        display: inline !important;
    }
    
    .search-btn i {
        display: none !important;
    }
    
    /* Mobile dropdown adjustments - Safari iOS compatible */
    .state-dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        bottom: auto !important;
        left: 0 !important;
        right: 0 !important;
        max-height: 60vh !important;
        border-radius: 8px !important;
        margin: 2px 0 0 0 !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
        z-index: 9999 !important;
        transform: none !important;
        -webkit-transform: none !important;
    }

    /* Ensure parent container allows overflow */
    .state-dropdown-wrapper {
        position: relative !important;
        overflow: visible !important;
        z-index: 200 !important;
    }

    /* Force hero section to allow overflow for dropdowns */
    .hero-section {
        overflow: visible !important;
        position: relative !important;
        z-index: 1 !important;
    }

    /* Ensure search container allows overflow */
    .search-container {
        overflow: visible !important;
        position: relative !important;
        z-index: 100 !important;
    }

    /* Safari iOS specific fixes */
    .state-dropdown-menu.show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }

    /* Prevent body scroll when dropdown is open on iOS */
    body.dropdown-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }
    
    /* Enhanced mobile visibility for registration button */
    .navbar .btn-outline-warning {
        font-size: 0.85rem !important;
        padding: 6px 12px !important;
        margin-bottom: 8px !important;
        min-width: 160px !important;
        text-align: center !important;
    }
}

@media (max-width: 576px) {
    /* Hero section styles moved to homepage.html for better control */
    
    .display-3 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1.1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Badge styles */
.badge {
    font-weight: 500;
}

/* Animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Remove animation from hero section for better LCP */
.hero-section .container > .row {
    animation: none;
}

/* Custom spacing */
.py-6 {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

/* Custom colors for different law specialties */
.bg-legal-civil { background-color: var(--primary-light); }
.bg-legal-penal { background-color: #dc3545; }
.bg-legal-famille { background-color: var(--secondary-color); }
.bg-legal-affaires { background-color: var(--primary-color); }
.bg-legal-immobilier { background-color: #fd7e14; }
.bg-legal-travail { background-color: #e83e8c; }
.bg-legal-fiscal { background-color: #6c757d; }
.bg-legal-international { background-color: var(--primary-hover); }
.bg-legal-environnement { background-color: #198754; }

/* Gradient backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%) !important;
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-light) 100%) !important;
}

/* Loading animation for dynamic content */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Authentication Pages Styles */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 60px 0;
}

.auth-page .card {
    border-radius: 15px;
}

.auth-page .card-header {
    border-radius: 15px 15px 0 0 !important;
}

.auth-page .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(27, 42, 67, 0.25);
}

.auth-page .btn-primary,
.auth-page .bg-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.auth-page .btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    transform: translateY(-1px);
}

.auth-page .text-primary {
    color: var(--primary-color) !important;
}

.auth-page .btn-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    border: none;
    color: #212529;
}

.auth-page .btn-warning:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00);
    transform: translateY(-1px);
    color: #212529;
}

/* Login Page Marketing Content Styles */
.login-marketing-content {
    height: 100%;
    display: flex;
    align-items: center;
}

.marketing-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 3rem;
    border: none;
}

.marketing-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.marketing-header h1 i {
    color: var(--secondary-color);
}

.marketing-body {
    margin-top: 1.5rem;
}

.marketing-item {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.marketing-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(27, 42, 67, 0.2);
}

.marketing-icon.success {
    background: linear-gradient(135deg, #198754, #157347);
}

.marketing-icon.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
}

.marketing-text {
    flex: 1;
}

.marketing-text .lead {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.marketing-text p {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 0;
}

.marketing-stats {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 6px 20px rgba(27, 42, 67, 0.2);
}

.stat-item {
    color: #ffffff;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.95;
    font-weight: 500;
}

.marketing-features {
    border-top: 2px solid #e9ecef !important;
}

.feature-badge {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-badge:hover {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(27, 42, 67, 0.1);
    transform: translateY(-2px);
}

.feature-badge i {
    display: block;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.feature-badge small {
    color: #495057;
    font-weight: 600;
    font-size: 0.85rem;
}

.login-card {
    border-radius: 15px;
}

/* Responsive adjustments for login page */
@media (max-width: 991.98px) {
    .marketing-card {
        padding: 2rem;
        margin-bottom: 2rem;
    }
    
    .marketing-header h1 {
        font-size: 1.75rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 767.98px) {
    .auth-page {
        padding: 40px 0;
    }
    
    .marketing-card {
        padding: 1.5rem;
    }
    
    .marketing-header h1 {
        font-size: 1.5rem;
    }
    
    .marketing-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .auth-page .card-body {
        padding: 2rem 1.5rem !important;
    }
}

/* Specific override for quien-somos page */
.quien-somos-green .bg-primary {
    background-color: var(--primary-color) !important;
}

.quien-somos-green .text-primary {
    color: var(--primary-color) !important;
}

.quien-somos-green .btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.quien-somos-green .btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.quien-somos-green .btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.quien-somos-green .btn-outline-primary:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

/* Registration Forms Styles */
.plan-info {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
}

.form-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 3px solid var(--primary-color);
}

.form-section h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.opening-hours-day {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
}

.image-preview {
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 5px;
    border: 2px solid #ddd;
}

.map-container {
    height: 300px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.social-media-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    margin-right: 10px;
    color: white;
    font-size: 18px;
}

.facebook-icon { background-color: #1877f2; }
.instagram-icon { background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); }
.linkedin-icon { background-color: #0077b5; }
.twitter-icon { background-color: #1da1f2; }
.youtube-icon { background-color: #ff0000; }

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.progress-indicator {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.progress-step {
    display: inline-block;
    padding: 5px 15px;
    margin: 0 5px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-step.active {
    background-color: var(--primary-color);
    color: white;
}

.progress-step.inactive {
    background-color: #e9ecef;
    color: #6c757d;
}

/* Password Reset specific styles */
.password-reset-page .form-control:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

/* Preregister Page Styles */
.content-section {
    background: white;
    border-radius: 10px;
    padding: 40px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.feature-list li:last-child {
    border-bottom: none;
}

.comparison-table {
    background: white;
    border-radius: 10px;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.comparison-table table {
    min-width: 600px;
    margin-bottom: 0;
    width: 100%;
    border-collapse: collapse;
}

.comparison-table .table {
    margin-bottom: 0;
}

.comparison-table thead th {
    vertical-align: middle;
    white-space: nowrap;
}

.comparison-table tbody td {
    vertical-align: middle;
}

/* Ensure table headers are sticky on scroll for better UX */
@media (max-width: 768px) {
    .comparison-table {
        margin: 0 -15px;
        border-radius: 0;
        padding: 0;
    }
    
    .comparison-table table {
        font-size: 0.85rem;
        min-width: 700px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem 0.4rem;
    }
    
    .comparison-table th:first-child,
    .comparison-table td:first-child {
        position: sticky;
        left: 0;
        background: white;
        z-index: 10;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        min-width: 140px;
        max-width: 140px;
        white-space: normal;
        word-wrap: break-word;
    }
    
    .comparison-table thead th:first-child {
        background: #212529;
        color: white;
        z-index: 11;
    }
    
    .comparison-table thead th.bg-warning {
        background-color: #ffc107 !important;
        color: #212529 !important;
    }
    
    .comparison-table thead th.bg-success {
        background-color: #198754 !important;
        color: white !important;
    }
}

.testimonial {
    background: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.preregister-hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 100px 0 60px 0; /* More space at top for h1 */
    text-align: center;
    margin-top: -76px; /* Remove white space between navbar and hero section */
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-success {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Page Header Class - Reusable for all pages */
.page-header {
    background-color: var(--primary-color) !important;
    margin-top: 76px;
    padding-top: 3rem;
    padding-bottom: 3rem;
    color: white;
}

/* JavaScript Animation Classes (moved from main.js to prevent FOUC) */
.animate-fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

.navbar-scrolled {
    background-color: rgba(27, 42, 67, 0.98) !important;
    backdrop-filter: blur(10px);
}

/* Pagination Styles */
.pagination .page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
    transition: all 0.2s ease-in-out;
}

.pagination .page-link:hover {
    color: white;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.active .page-link:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.pagination .page-link:focus {
    color: var(--primary-color);
    background-color: #e9ecef;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(27, 42, 67, 0.25);
}

/* Navbar dropdown styles to avoid conflicts */
.navbar {
    z-index: 1030; /* Bootstrap default for navbar */
}

.navbar-dropdown-menu {
    z-index: 1031 !important; /* Higher than navbar but lower than search dropdown */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* Search dropdown specific styles */
.search-dropdown-menu {
    z-index: 120 !important; /* Higher than navbar dropdowns for search context */
}

/* Global Blue Theme Override for Bootstrap Primary Classes */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.bg-primary.bg-opacity-10 {
    background-color: rgba(27, 42, 67, 0.1) !important;
}

/* Form controls focus with green theme */
.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(27, 42, 67, 0.25) !important;
}

.form-check-input:checked {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Badge primary */
.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Button group and other Bootstrap components */
.btn-group .btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* List group item active */
.list-group-item.active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Nav pills */
.nav-pills .nav-link.active {
    background-color: var(--primary-color) !important;
}

/* Alert primary */
.alert-primary {
    background-color: rgba(27, 42, 67, 0.1) !important;
    border-color: var(--primary-color) !important;
    color: #1a2332 !important;
}

/* Progress bar */
.progress-bar {
    background-color: var(--primary-color) !important;
}

/* Secondary Color Utilities */
.bg-secondary-custom {
    background-color: var(--secondary-color) !important;
}

.text-secondary-custom {
    color: var(--secondary-color) !important;
}

.border-secondary-custom {
    border-color: var(--secondary-color) !important;
}

.btn-secondary-custom {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: white !important;
}

.btn-secondary-custom:hover {
    background-color: var(--secondary-light) !important;
    border-color: var(--secondary-light) !important;
    color: white !important;
}

.btn-outline-secondary-custom {
    color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
}

.btn-outline-secondary-custom:hover {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: white !important;
}

/* Additional Safari iOS specific styles */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    .state-dropdown-menu {
        -webkit-overflow-scrolling: touch !important;
        will-change: transform !important;
    }
}

/* Hero section styles managed in homepage.html */

.state-dropdown-wrapper {
    overflow: visible !important;
}

/* Ensure proper stacking context for different dropdown types */
.dropdown-menu {
    /* Default z-index for regular dropdowns */
    z-index: 1000;
}

.navbar .dropdown-menu {
    /* Navbar dropdowns get higher priority than regular dropdowns */
    z-index: 1031 !important;
}

.search-container .dropdown-menu {
    /* Search dropdowns get highest priority in hero section */
    z-index: 120 !important;
}

/* Search Input Validation */
.search-input.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Search Input Placeholder on Error */
.search-input.is-invalid::placeholder {
    color: #dc3545 !important;
    opacity: 0.8;
}

/* Mobile CTA Button - Fixed at bottom on mobile */
.mobile-cta-button {
    display: none; /* Hidden by default */
}

@media (max-width: 768px) {
    .mobile-cta-button {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1020; /* Below navbar (1030) but above most content */
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(15px) saturate(180%);
        -webkit-backdrop-filter: blur(15px) saturate(180%);
        animation: slideInUp 0.5s ease-out;
        box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.08);
    }
    
    .mobile-cta-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light)) !important;
        border: none !important;
        color: white !important;
        font-weight: 700 !important;
        font-size: 16px !important;
        padding: 16px 24px !important;
        border-radius: 12px !important;
        text-decoration: none !important;
        box-shadow: 0 4px 20px rgba(178, 144, 103, 0.5) !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
        transition: all 0.3s ease !important;
        position: relative;
        overflow: hidden;
    }
    
    /* Shimmer effect */
    .mobile-cta-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        animation: shimmer 3s infinite;
    }
    
    @keyframes shimmer {
        0% { left: -100%; }
        50% { left: 100%; }
        100% { left: 100%; }
    }
    
    @keyframes slideInUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    .mobile-cta-btn:hover,
    .mobile-cta-btn:active {
        background: linear-gradient(135deg, #9e7c56, #8a6b49) !important;
        transform: scale(1.02) !important;
        box-shadow: 0 6px 25px rgba(178, 144, 103, 0.6) !important;
    }
    
    .mobile-cta-btn i {
        font-size: 20px;
        animation: pulse 2s infinite;
    }
    
    @keyframes pulse {
        0%, 100% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.1);
        }
    }
    
    /* Adjust footer padding to prevent content from being hidden behind the CTA button */
    footer {
        padding-bottom: calc(env(safe-area-inset-bottom) + 80px) !important;
    }
    
    /* Adjust toast container position to not conflict with mobile CTA */
    .toast-container.position-fixed.bottom-0 {
        bottom: 80px !important;
    }
}

/* ===== Preregister page enhancements ===== */
/* Hero CTA buttons and trust badges */
.hero-cta-buttons .btn {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.trust-badges .badge-item {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 500;
    backdrop-filter: blur(6px);
}

/* Steps section */
.steps-section .step-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    position: relative;
}

.steps-section .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 12px;
}

/* Premium card ribbon */
.premium-card .card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)) !important;
}

/* Ribbon styles - common for all cards */
.ribbon {
    width: 150px;
    height: 150px;
    overflow: hidden;
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 10;
}

.ribbon span {
    position: absolute;
    display: block;
    width: 200px;
    padding: 10px 0;
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    transform: rotate(45deg);
    top: 32px;
    right: -40px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.ribbon-success span {
    background: #198754;
}

.ribbon-warning span {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    border: 2px solid rgba(255,255,255,0.3);
}

@media (max-width: 576px) {
    .hero-cta-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}