/* ================= BASE ================= */
/* Gradient text used for brand highlights. */

.gradient-text {
    background: linear-gradient(90deg, #FF9933, #F4D35E, #138808);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero gradient background to emphasize the primary CTA section. */
.hero-bg {
    background: linear-gradient(135deg, #0A2540 0%, #1e3a8a 50%, #FF9933 100%);
}

/* Service card styling for consistent visual blocks. */
.service-card {
    background: linear-gradient(
        to bottom right,
        rgba(255,153,51,0.1),
        rgba(244,211,94,0.1)
    );
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255,153,51,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(255,153,51,0.15);
}

/* ================= ACCESSIBILITY ================= */
/* Screen reader only - visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to content link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0A2540;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #FF9933;
    outline-offset: 2px;
}

/* ================= CHAT ================= */
/* Floating action button for opening the chat widget. */

#chat-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #0A2540;
    color: #fff;
    font-size: 22px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

#chat-fab:active {
    transform: scale(0.95);
}

/* Chat container with fixed position and stacked layout. */
#chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 340px;
    height: 420px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    display: none;
    flex-direction: column;
    z-index: 1000;
}

/* Chat header bar with title and close control. */
.chat-header {
    background: #0A2540;
    color: white;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 14px 14px 0 0;
    font-weight: 600;
}

.chat-header button {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.chat-header button:hover {
    background: rgba(255,255,255,0.1);
}

/* Scrollable chat transcript area. */
.chat-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: #f9fafb;
    font-size: 13px;
}

/* Custom scrollbar for chat */
.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Input row for user text and send button. */
.chat-input {
    display: flex;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid #e5e7eb;
    background: white;
    border-radius: 0 0 14px 14px;
}

/* Chat text input field styling. */
.chat-input input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.chat-input input:focus {
    outline: none;
    border-color: #FF9933;
}

/* Chat send button styling. */
.chat-input button {
    background: #FF9933;
    color: white;
    padding: 6px 14px;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.chat-input button:hover:not(:disabled) {
    background: #e68a2e;
}

.chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile responsive chat */
@media (max-width: 640px) {
    #chat-widget {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 80px;
        max-height: 60vh;
    }
    
    #chat-fab {
        right: 15px;
        bottom: 15px;
    }
}

/* ================= CONTACT MODAL (BULLETPROOF) ================= */

/* Full-screen overlay ensures the modal sits above all content. */
#contact-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.55);
    display: none;
    z-index: 5000;
}

/* Centered modal for lead capture. */
#contact-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    width: 92%;
    max-width: 420px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.35);
    z-index: 5001;
    max-height: 90vh;
    overflow-y: auto;
}

/* Modal header with title and close button. */
.contact-header {
    background: #0A2540;
    color: #fff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.contact-header button {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.contact-header button:hover {
    background: rgba(255,255,255,0.1);
}

/* Form layout with vertical spacing between inputs. */
.contact-form {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Shared styling for form inputs and textarea. */
.contact-form input,
.contact-form textarea {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #FF9933;
    box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 100px;
}

/* Primary submit button for the contact form. */
.contact-form button {
    background: #FF9933;
    color: #fff;
    padding: 12px;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s ease, transform 0.2s ease;
    position: relative;
}

.contact-form button:hover:not(:disabled) {
    background: #e68a2e;
    transform: translateY(-1px);
}

.contact-form button:active:not(:disabled) {
    transform: translateY(0);
}

.contact-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ================= LOADING STATES ================= */

/* Loading spinner animation */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #FF9933;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

/* Chat typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    align-items: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ================= TRANSITIONS & ANIMATIONS ================= */

/* Smooth transitions for interactive elements */
a, button {
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

/* Fade in animation for sections */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================= MOBILE RESPONSIVENESS ================= */

@media (max-width: 768px) {
    /* Adjust hero text size on mobile */
    .hero-bg h1 {
        font-size: 2.5rem;
    }
    
    /* Stack service cards on mobile */
    .service-card {
        margin-bottom: 1rem;
    }
    
    /* Adjust padding on mobile */
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 480px) {
    /* Further adjustments for very small screens */
    .contact-modal {
        width: 95%;
        max-height: 85vh;
    }
    
    /* Smaller buttons on mobile */
    .hero-bg button {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* ================= PRINT STYLES ================= */

@media print {
    /* Hide interactive elements when printing */
    #chat-fab,
    #chat-widget,
    #contact,
    nav {
        display: none !important;
    }
    
    /* Ensure good print layout */
    body {
        background: white;
        color: black;
    }
    
    .hero-bg {
        background: white;
        color: black;
    }
}
