/* ===================================
MODERN FORM STYLES
================================== */

.contact-form {
    max-width: 850px; /* Slightly wider for modern look */
    margin: var(--spacing-xl) auto;
    background: var(--white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    font-family: inherit;
}

.contact-form h2 {
    margin: 0 0 1rem;
}

.form-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.form-title {
    color: var(--secondary-gray);
    font-size: 1.8rem;
    margin-bottom: var(--spacing-xs);
}

.form-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Grid Layout for Desktop */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 var(--spacing-md);
}

.form-group {
    position: relative;
    margin-bottom: var(--spacing-md);
}

/* Input Styles */
input,
textarea,
select {
    width: 100%;
    padding: 1rem 1rem 0.5rem 1rem; /* Top padding for label space */
    border: 1px solid var(--light-gray); /* Thinner, modern border */
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--off-white);
    transition: all 0.3s ease;
    color: var(--text-primary);
    min-height: 56px; /* Material Design standard height */
}

textarea {
    min-height: 150px;
    resize: vertical;
}

/* Remove default focus outline to use our custom one */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    background: var(--white);
    border-color: var(--primary-blue);
    box-shadow: 0 4px 10px rgba(25, 118, 210, 0.1);
}

/* Floating Label Styles */
label {
    position: absolute;
    left: 1rem;
    top: 40%;
    transform: translateY(-50%);
    background: transparent;
    padding: 0 0.2rem;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.2s ease-in-out;
    pointer-events: none; /* Allows clicking through label to input */
    z-index: 1;
    line-height: 1;
}

/* Label positioning for Textarea */
textarea + label {
    top: 1.5rem;
    transform: translateY(-50%);
}

/* FLOATING ANIMATION LOGIC */
/* Float label if: Input has focus OR Input is not empty (placeholder not shown) */
input:focus + label,
input:not(:placeholder-shown) + label,
textarea:focus + label,
textarea:not(:placeholder-shown) + label,
select:focus + label,
select:valid + label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    background: var(--white); /* Masks the border behind label */
    font-weight: 600;
    color: var(--primary-blue);
    border-radius: var(--radius-sm);
    line-height: 1.8;
}

/* Select Box Specifics */
select {
    appearance: none;
    cursor: pointer;
}

/* ===================================
   CONTACT CARD STYLES
   ==================================*/
.contact-card .card-icon svg {
    vertical-align: middle;
}

.contact-card .card-icon svg.whatsapp-icon {
    fill: #25D366;
}

.contact-card .card-icon svg.facebook-icon {
    fill: #1877F2;
}

.contact-card .card-icon svg.tiktok-icon {
    fill: #000;
}

.card-icon .simple-icon {
    fill: var(--primary-blue);
}

/* ===================================
   CONTACT CARDS GRID
   ================================== */
.contact-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.contact-card {
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.contact-card h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.contact-card p {
    color: var(--text-secondary);
}

.contact-card a {
    color: var(--primary-blue);
    font-weight: 600;
}

/* ===================================
   SPINNER & LOADING STATES
   ================================== */
.spinner {
    width: 20px;
    height: 20px;
    animation: rotate 2s linear infinite;
}

.path {
    stroke: #fff;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Button Loading State */
#submitBtn.loading .btn-text {
    visibility: hidden;
}

#submitBtn.loading .spinner {
    display: block;
    position: absolute;
}

#submitBtn {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ===================================
   ERROR MESSAGE STYLES
   ================================== */
.error-message {
    color: var(--error-red);
    font-size: 0.875rem;
    display: block;
    margin-top: 0.25rem;
    min-height: 1rem; /* Reserve space to prevent layout shifts */
}

.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: var(--error-red);
    background-color: #FFF4F4;
}

/* When error exists, label turns red */
.form-group input.error + label,
.form-group textarea.error + label,
.form-group select.error + label {
    color: var(--error-red);
}

.form-group label {
    line-height: 50px;
}

/* ===================================
   RESPONSIVE STYLES
   ================================== */

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .contact-form h2 {
        font-size: 1.5rem;
    }

    .contact-form {
        padding: var(--spacing-md);
    }

    .form-group {
        margin-bottom: var(--spacing-sm);
    }

    .contact-cards-grid {
        grid-template-columns: 1fr;
    }
}