/* --- Contact Us Section --- */

.contact-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
    align-items: stretch;
    margin: 4rem 0;
    position: relative;
    z-index: 10;
}

/* Magic Flexbox Layout: 
  Left side acts as a rigid block ~450px on desktop. 
  When the screen shrinks, it automatically expands to 100% width and stacks on top. 
*/
.contact-info-left {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 400px; /* Base trigger width */
    max-width: 100%;
}

/* Right side takes all remaining extra space due to massive flex-grow */
.contact-form-right {
    flex-grow: 9999;
    flex-shrink: 1;
    flex-basis: 500px; /* Ensures wrapping kicks in automatically on tablets/phones */
    background: var(--white);
    padding: clamp(2rem, 5vw, 4rem); /* Responsive padding without media queries */
    border-radius: 1.5rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(30, 144, 255, 0.15);
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

/* Top decorative glow bar for form card */
.contact-form-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--brand-blue-400), var(--brand-purple), var(--brand-green));
}

/* Auto-wrapping form rows for inputs */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 200px;
}

/* Ensures single column items still share the same bottom margin natively */
.contact-form-right > form > .form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    font-weight: bold;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.contact-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 2px solid var(--gray-200);
    background-color: var(--gray-50);
    color: var(--dark-text);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.4s var(--transition-curve);
}

/* Elegant border glow effects */
.contact-input:hover {
    border-color: var(--brand-blue-400);
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.15);
    background-color: var(--white);
}

.contact-input:focus {
    outline: none;
    border-color: var(--brand-blue-500);
    background-color: var(--white);
    box-shadow: var(--glow-blue);
}

textarea.contact-input {
    resize: vertical;
    min-height: 120px;
}

/* Google reCAPTCHA Wrapper */
.recaptcha-wrapper {
    margin: 1.5rem 0;
    min-height: 78px; /* Standard reCAPTCHA height to prevent layout jumps when script loads */
    width: 100%;
    overflow: hidden; /* Keeps the widget from breaking boundaries on tiny phones */
}

/* Dynamic Button State */
.btn-submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-blue-600);
    color: var(--white);
    padding: 1.125rem 2rem;
    border-radius: 1rem;
    font-weight: bold;
    font-size: 1.125rem;
    border: 2px solid var(--brand-blue-600);
    transition: all 0.4s var(--transition-curve);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    gap: 0.75rem;
}

.btn-submit:hover:not(.submitted) {
    background: var(--white);
    color: var(--brand-blue-600);
    box-shadow: var(--glow-blue);
}

/* Grayed out state when clicked */
.btn-submit.submitted {
    background: var(--gray-500);
    border-color: var(--gray-500);
    color: var(--white);
    cursor: not-allowed;
    box-shadow: none;
}

/* Spinner Animation for Submission Process */
@keyframes loading-spin {
    100% { transform: rotate(360deg); }
}