/* =========================================
   Contact Us Page — Premium Styling
   ========================================= */

/* Use variables matching the white theme of research.css */
.contact-page {
    background: var(--r-bg, #ffffff);
    color: var(--r-text, #1a1a2e);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    animation: contact-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes contact-fade-in {
    to { opacity: 1; }
}

/* Base resets & layout */
.contact-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 140px; /* Generous gap from absolute header */
    padding-bottom: 80px; /* Generous bottom padding for scroll experience */
    position: relative;
    z-index: 10;
}

.contact-container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2.5rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4.5rem;
    align-items: start;
}

/* =========================================
   Left Pane: Brand & Contact Info
   ========================================= */
.contact-info-pane {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 1rem;
}

.contact-pretitle {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--r-blue, #0066ff);
    margin-bottom: 0.75rem;
}

.contact-title {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.5px;
    color: var(--r-text, #1a1a2e);
    margin-bottom: 1.25rem;
}

.contact-subtitle {
    font-size: 1.05rem;
    color: var(--r-text-light, #4a5568);
    line-height: 1.7;
    margin-bottom: 2.25rem;
    max-width: 500px;
}

.contact-cards-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

/* Static Premium Contact Cards */
.contact-card-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: #ffffff;
    border: 1px solid var(--r-border, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.contact-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(0, 102, 255, 0.06);
    border-radius: 10px;
    color: var(--r-blue, #0066ff);
    font-size: 1.35rem;
    flex-shrink: 0;
}

.contact-card-content {
    flex: 1;
}

.contact-card-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--r-text-muted, #718096);
    margin-bottom: 0.65rem;
}

.contact-card-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--r-text, #1a1a2e);
    line-height: 1.5;
}

.contact-card-value a {
    color: inherit;
    transition: color 0.2s ease;
}

.contact-card-value a:hover {
    color: var(--r-text, #1a1a2e);
    text-decoration: none;
}


/* Office address detail adjustments */
.contact-address-text {
    font-style: normal;
    color: var(--r-text, #1a1a2e);
    font-size: 0.95rem;
    display: block;
}


/* Press Inquiries info text */
.contact-press-text {
    font-size: 0.95rem;
    color: var(--r-text, #1a1a2e);
    margin-bottom: 0.25rem;
}

/* Social links styling */
.contact-socials-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.contact-social-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--r-text-muted, #718096);
    letter-spacing: 0.5px;
}

.contact-social-list {
    display: flex;
    gap: 0.75rem;
}

.contact-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--r-bg-alt, #f7f9fc);
    border: 1px solid var(--r-border, #e2e8f0);
    border-radius: 50%;
    color: var(--r-text-light, #4a5568);
    font-size: 1.1rem;
    transition: all 0.25s ease;
}

.contact-social-link:hover {
    background: var(--r-text, #1a1a2e);
    color: #ffffff;
    border-color: var(--r-text, #1a1a2e);
    transform: translateY(-2px);
}

/* =========================================
   Right Pane: Contact Form Panel
   ========================================= */
.contact-form-pane {
    display: flex;
    flex-direction: column;
}

.contact-form-card {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--r-border, #e2e8f0);
    border-radius: 16px;
    padding: 2.25rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.03);
    position: relative;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-form-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--r-text, #1a1a2e);
    margin-bottom: 0.5rem;
}

.contact-form-desc {
    font-size: 0.88rem;
    color: var(--r-text-light, #4a5568);
    margin-bottom: 1.75rem;
}

/* Modern Outlined Form Inputs */
.contact-form-element {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.contact-form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--r-text-light, #4a5568);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-form-required {
    color: #ef4444;
    font-size: 0.75rem;
}

.contact-form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--r-bg-alt, #f7f9fc);
    border: 1.5px solid var(--r-border, #e2e8f0);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--r-text, #1a1a2e);
    transition: all 0.25s ease;
    outline: none;
}

.contact-form-input::placeholder {
    color: var(--r-text-muted, #718096);
    opacity: 0.65;
}

.contact-form-input:focus {
    border-color: #cbd5e1;
    background: #ffffff;
}

textarea.contact-form-input {
    resize: none;
    height: 100px;
}

/* Submit Button Customizations */
.contact-submit-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.85rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    background: var(--r-text, #1a1a2e);
    color: #ffffff;
    border: 1.5px solid var(--r-text, #1a1a2e);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.1);
}

.contact-submit-btn:hover {
    background: #111122;
    border-color: #111122;
    box-shadow: 0 6px 16px rgba(26, 26, 46, 0.2);
    transform: translateY(-1px);
}

.contact-submit-btn:active {
    transform: translateY(0);
}

/* Button Loading State */
.contact-submit-btn.loading {
    background: var(--r-text-muted, #718096);
    border-color: var(--r-text-muted, #718096);
    pointer-events: none;
    opacity: 0.85;
}

.contact-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: contact-spin 0.6s linear infinite;
    display: none;
}

.contact-submit-btn.loading .contact-spinner {
    display: inline-block;
}

@keyframes contact-spin {
    to { transform: rotate(360deg); }
}

/* =========================================
   Success Feedback Overlay State
   ========================================= */
.contact-success-state {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 16px;
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 5;
}

.contact-form-card.success .contact-success-state {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.contact-form-card.success .contact-form-inner {
    opacity: 0;
    visibility: hidden;
}

.contact-success-icon {
    width: 64px;
    height: 64px;
    background: #d1fae5;
    color: #059669;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    animation: success-bounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes success-bounce {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.contact-success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--r-text, #1a1a2e);
    margin-bottom: 0.75rem;
}

.contact-success-desc {
    font-size: 0.95rem;
    color: var(--r-text-light, #4a5568);
    line-height: 1.6;
    margin-bottom: 1.75rem;
    max-width: 320px;
}

/* =========================================
   Slim Footer Bar (Locks to bottom of 100vh)
   ========================================= */
.contact-slim-footer {
    padding: 1rem 0;
    border-top: 1px solid var(--r-border, #e2e8f0);
    background: #ffffff;
    z-index: 100;
}

.contact-slim-footer-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--r-text-muted, #718096);
}

.contact-slim-links {
    display: flex;
    gap: 1.5rem;
}

.contact-slim-links a {
    color: inherit;
    transition: color 0.2s ease;
    text-decoration: none;
}

.contact-slim-links a:hover {
    color: var(--r-text, #1a1a2e);
}

/* =========================================
   Responsive Design & Mobile Fallbacks
   ========================================= */

/* Viewports where split height starts squeezing (Desktop low height or iPad/Tablet landscape) */
@media (max-height: 760px) and (min-width: 901px) {
    .contact-title {
        font-size: 2.25rem;
    }
    .contact-subtitle {
        margin-bottom: 1.25rem;
    }
    .contact-cards-container {
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    .contact-card-item {
        padding: 0.85rem 1.25rem;
    }
    .contact-form-card {
        padding: 1.75rem;
        min-height: 420px;
    }
    .contact-form-element {
        margin-bottom: 0.85rem;
    }
}

/* Tablets (Portrait) & Mobile Devices */
@media (max-width: 900px) {
    .contact-page {
        height: auto;
        min-height: 100vh;
        overflow-y: auto; /* Fallback to natural scrolling on mobile */
    }

    .contact-main {
        padding-top: 90px;
        padding-bottom: 40px;
    }

    .contact-container {
        max-height: none;
        padding: 0 1.5rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }

    .contact-info-pane {
        padding-right: 0;
        align-items: center;
        text-align: center;
    }

    .contact-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .contact-cards-container {
        width: 100%;
        max-width: 500px;
        text-align: left;
    }

    .contact-socials-container {
        flex-direction: column;
        gap: 0.75rem;
    }

    .contact-form-card {
        padding: 1.75rem;
        max-width: 500px;
        margin: 0 auto;
    }

    .contact-slim-footer-inner {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        padding: 0 1.5rem;
    }
}

@media (max-width: 480px) {
    .contact-title {
        font-size: 2rem;
    }
    .contact-card-item {
        padding: 1rem;
        gap: 1rem;
    }
    .contact-icon-box {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    .contact-phone-grid {
        flex-direction: column;
        gap: 0.25rem;
    }
}
