/* ==========================================
   RUNHAMS DECORATING - CONTACT FORM (5.5)
   Styles for includes/contact-section.php
   Labels above fields, no placeholders, required marked (Build Standards §16e).
   Class names match the form HTML exactly - #contactForm is tracked
   by WhatConverts, do not rename it.
   ========================================== */

/* ==========================================
   SECTION - grey, intro left / form card right
   ========================================== */

.contact-us {
    background:
        radial-gradient(700px 360px at 100% 0%, rgba(217, 15, 15, 0.07) 0%, rgba(217, 15, 15, 0) 60%),
        var(--grey);
    padding: var(--section-y) 0;
    position: relative;
}

.contact-container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
    position: relative;
    z-index: 2;
}

.contact-us--form-only .contact-container { display: block; max-width: 720px; }

/* ---------- Intro column ---------- */
.contact-intro { padding-top: 0.5rem; }
.contact-intro-heading {
    font-size: var(--fs-h2);
    font-weight: 700;
    line-height: 1.15;
    color: var(--ink);
    margin: 0 0 1rem;
}
.contact-intro-text {
    font-size: var(--fs-body);
    color: var(--muted);
    line-height: 1.75;
    margin: 0 0 1.5rem;
}
.contact-intro-text a {
    color: var(--brand);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(217, 15, 15, 0.3);
    word-break: break-word;
}
.contact-intro-text a:hover { text-decoration-color: currentColor; }

.contact-intro-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.contact-intro-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
}
.contact-intro-points i {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand-grad);
    color: #fff;
    font-size: 0.6875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

/* ==========================================
   FORM CARD - dark
   ========================================== */

.contact-form {
    background-color: var(--charcoal);
    padding: clamp(1.75rem, 4vw, 2.75rem);
    border-radius: var(--radius-lg);
    position: relative;
    box-shadow: var(--shadow-lg);
    border-top: 4px solid var(--brand);
}

.contact-heading {
    font-size: var(--fs-h3);
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin: 0 0 0.4rem;
}

.form__legend {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 1.5rem;
}

.req { color: #ff6b6b; font-weight: 700; }

/* ==========================================
   FIELDS - label above, hint between label and input
   ========================================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.15rem;
}

.form-group label {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.form__hint {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.68);
    margin: -0.15rem 0 0.1rem;
    line-height: 1.45;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    font-size: 1rem; /* 16px minimum - stops iOS zoom */
    font-family: var(--font-body);
    color: #fff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.contact-form textarea {
    min-height: 150px;
    resize: none; /* fixed size, no drag handle */
    line-height: 1.55;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px rgba(239, 58, 58, 0.25);
    background-color: rgba(255, 255, 255, 0.12);
}

/* Autofill - keep the dark look */
.contact-form input:-webkit-autofill,
.contact-form input:-webkit-autofill:hover,
.contact-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px #3d3d3d inset;
    border-color: rgba(255, 255, 255, 0.18);
    transition: background-color 5000s ease-in-out 0s;
}

/* ==========================================
   SUBMIT
   ========================================== */

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 54px;
    padding: 1rem;
    background: var(--brand-grad);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1.0625rem;
    font-family: var(--font-head);
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.5rem;
    box-shadow: 0 8px 22px rgba(217, 15, 15, 0.35);
    transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.submit-btn:hover { background: var(--brand-grad-hover); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(217, 15, 15, 0.45); }
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.submit-btn i { font-size: 0.875rem; transition: transform 0.25s ease; }
.submit-btn:hover i { transform: translateX(3px); }
.submit-btn .button-text { display: inline; }
.submit-btn .loading-spinner { display: none; color: inherit; font-weight: 600; }

/* ==========================================
   MESSAGES + FIELD ERRORS
   ========================================== */

.form-messages {
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    line-height: 1.5;
    font-weight: 600;
}
.form-messages.success { display: none !important; }
.form-messages.error {
    background-color: rgba(239, 68, 68, 0.14);
    color: #ffd0d0;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
.form-messages.error a { color: #fff; }

.error-message {
    color: #ffb4b4;
    font-size: 0.875rem;
    display: none;
    font-weight: 600;
}

.form-group input.error,
.form-group textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
    background-color: rgba(239, 68, 68, 0.06);
}

/* ===============================================
   FORM LOADING OVERLAY (shown on submit)
   =============================================== */
.form-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 17, 17, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: rd-overlay-in 0.2s ease;
}

.form-overlay .overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 2.5rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.form-overlay .overlay-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid rgba(0, 0, 0, 0.12);
    border-top-color: var(--rd-accent, #b50d0d);
    border-radius: 50%;
    animation: rd-spin 0.8s linear infinite;
}

.form-overlay .overlay-text {
    margin: 0;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    color: #222;
}

@keyframes rd-spin { to { transform: rotate(360deg); } }
@keyframes rd-overlay-in { from { opacity: 0; } to { opacity: 1; } }

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

@media (max-width: 900px) {
    .contact-container { grid-template-columns: 1fr; }
    .contact-intro { max-width: 640px; }
    .contact-form { max-width: 640px; width: 100%; }
}

@media (max-width: 480px) {
    .contact-form { border-radius: var(--radius); }
}

@media (prefers-reduced-motion: reduce) {
    .submit-btn, .submit-btn i { transition: none; }
    .submit-btn:hover { transform: none; }
    .form-overlay .overlay-spinner { animation-duration: 1.6s; }
}
