/* =============================================================
   CONTACT PAGE — MOBILE WIDTH FIX
   Loaded LAST on contact.html only, so it wins the cascade.

   PROBLEM: On mobile the input fields were only ~67% of the
   viewport width (~16% empty margin on each side), because the
   fields got side padding TWICE — once from .container (30px)
   and again from the per-field padding (30px) inside the
   full-bleed form card. That made the fields look thin.

   GOAL: fields should span nearly edge-to-edge (~92% width,
   ~4% side margin) like the reference design.

   Everything is wrapped in a mobile media query — DESKTOP IS
   NOT TOUCHED.
   ============================================================= */

@media (max-width: 768px) {

    /* ROOT CAUSE: service.css sets .contact-form-card{padding:44px} and
       loads AFTER style.css, so it overrode the mobile padding:0 reset —
       leaving a 44px inset on every field. Force the card flush so its
       inner padding no longer eats into field width. */
    .contact-form-card {
        padding: 0 !important;
    }

    /* The form card already bleeds full width via negative margins.
       Reduce the per-element side padding from 30px down to 16px so
       the fields sit close to the screen edges (≈4% margin). */
    .contact-form-card .form-row,
    .contact-form-card > form > .form-group,
    .contact-form-card .form-group-checkbox {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Nested groups inside a former 2-col row must not add their own
       side padding on top of the row's padding. */
    .contact-form-card .form-row .form-group {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Heading + intro line up with the fields */
    .contact-form-card h2,
    .contact-form-card .contact-form-intro {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Breathing room ABOVE the "Start Your Project" heading */
    .contact-form-card h2 {
        margin-top: 28px !important;
    }

    /* Breathing room BELOW the submit button */
    .contact-form-card button[type="submit"] {
        margin-bottom: 32px !important;
    }

    /* Submit button matches the same near-edge width */
    .contact-form-card button[type="submit"] {
        margin-left: 16px !important;
        margin-right: 16px !important;
        width: calc(100% - 32px) !important;
    }

    /* Make every field fill its (now wider) column edge-to-edge */
    .contact-form-card .form-group input:not([type="checkbox"]),
    .contact-form-card .form-group select,
    .contact-form-card .form-group textarea,
    .contact-form-card .file-upload-label {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Slightly THINNER field height on mobile for a cleaner look
       (Blueberry-style). Reduce vertical padding 15px -> 10px so text
       inputs are ~44px tall instead of ~54px. font-size stays 16px to
       keep iOS from auto-zooming on focus. Textarea keeps its taller
       multi-line height. */
    .contact-form-card .form-group input:not([type="checkbox"]),
    .contact-form-card .form-group select {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        min-height: 0 !important;
        line-height: 1.4 !important;
    }

    .contact-form-card .form-group textarea {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    /* ----------------------------------------------------------
       FAST LOAD — stop the reveal animation from hiding the form
       until the (slow) Forminit SDK + scroll observer run.
       ---------------------------------------------------------- */
    .contact-form-card.reveal,
    .contact-sidebar.reveal,
    .contact-quick-info.reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    /* ----------------------------------------------------------
       SCROLL FIX — remove the overflow-x scroll-trap on the
       contact page (overflow-x:hidden on <main> creates an iOS
       Safari touch-scroll container that can lock/jank the page).
       ---------------------------------------------------------- */
    main {
        overflow-x: visible !important;
    }
}

/* Smaller phones: container padding drops to 20px, so match the
   full-bleed math (card bleeds by -20px each side). Keep the same
   ~16px near-edge field inset. */
@media (max-width: 480px) {
    .contact-form-card .form-row,
    .contact-form-card > form > .form-group,
    .contact-form-card .form-group-checkbox,
    .contact-form-card h2,
    .contact-form-card .contact-form-intro {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    .contact-form-card button[type="submit"] {
        margin-left: 16px !important;
        margin-right: 16px !important;
        width: calc(100% - 32px) !important;
    }
}

/* =============================================================
   INLINE FORM SUCCESS PANEL (all viewports)
   Shown after a successful submit, in place of the form.
   ============================================================= */
.form-success-panel {
    text-align: center;
    padding: 40px 24px 44px;
    animation: formSuccessIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes formSuccessIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.form-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #fff;
    background: linear-gradient(135deg, #FF006E, #FF8C42);
    box-shadow: 0 10px 26px rgba(255, 0, 110, 0.3);
}

.form-success-panel h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.35rem, 4vw, 1.7rem);
    font-weight: 800;
    color: #222;
    margin: 0 0 12px;
    line-height: 1.25;
}

.form-success-panel > p {
    color: #555;
    font-size: 1rem;
    line-height: 1.65;
    max-width: 460px;
    margin: 0 auto 28px;
}

.form-success-cta {
    border-top: 1px solid #eee;
    padding-top: 26px;
    max-width: 460px;
    margin: 0 auto;
}

.form-success-cta-lead {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #222;
    font-size: 1.02rem;
    margin: 0 0 14px;
}

.form-success-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 15px 20px;
    background: #25D366;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.3;
    text-decoration: none;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(37, 211, 102, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-success-whatsapp i {
    font-size: 1.25rem;
}

.form-success-whatsapp:hover {
    background: #1FB955;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.45);
}
