/* ==========================================================================
   SHARED CONSULTATION SECTION — the homepage design, applied everywhere else
   ==========================================================================

   The approved design lives on the homepage in
   partials/home/consultation.blade.php. That section is NOT touched by this
   file: every selector below carries :not(.tk-consult-section), which is the
   class only the homepage section has. The homepage keeps rendering from its
   own ID-scoped <style>, so it cannot regress from anything here.

   Why CSS and not a shared Blade partial: the other consultation sections are
   legacy Gravity Forms markup whose ids and names are load-bearing.
   servicedetails.blade.php's own script binds #input_30_18 (phone) and
   #input_30_country_code, intl-tel-input attaches to that same input, and
   app/Http/Requests/ConsultationRequestStoreRequest.php reads both the
   canonical names (full_name/email/phone/country_code) and the legacy
   input_N fallbacks. Restyling the existing markup keeps every one of those
   contracts byte-identical while still delivering one approved design.

   Values below are copied from the approved homepage implementation rather
   than re-invented.
   ========================================================================== */

/* ---- Section ground ---------------------------------------------------- */
/* Written as `section.` + two classes (0,2,1) so it outweighs the legacy
   `main .bgplaingrey { background-color:#0b0b0b }` at (0,1,1). */
section.bookconsul:not(.tk-consult-section) {
    background-color: #090B0C;
    background-image: radial-gradient(120% 70% at 50% 100%, rgba(0, 115, 252, 0.05), rgba(0, 115, 252, 0) 60%);
}

/* ---- The card ---------------------------------------------------------- */
/* On these pages the legacy sheet already paints a card on the row itself
   (.bookconsul .row.gy-4.align-items-center { background:#171717 }), so that
   row IS the card here — it is restyled in place rather than nested inside a
   second box. overflow stays visible: that is what would clip the phone
   country dropdown. */
.bookconsul:not(.tk-consult-section) .row.gy-4.align-items-center {
    position: relative;
    margin: 0 16px;
    padding: clamp(26px, 3.6vw, 54px) clamp(20px, 3.2vw, 50px);
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 24px;
    background: linear-gradient(#141719, #101315);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 32px rgba(0, 0, 0, 0.45);
}

.bookconsul:not(.tk-consult-section) .consultantform {
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: 0 0;
    box-shadow: none;
}

/* ---- Heading ----------------------------------------------------------- */
.bookconsul:not(.tk-consult-section) .consultantform .main-title,
.bookconsul:not(.tk-consult-section) .consultantform h2.main-title {
    max-width: 16ch;          /* holds "BOOK A FREE / CONSULTATION" on two lines */
    margin: 0 0 26px;
    color: #F3F5F7;
    font-size: clamp(30px, 3.9vw, 54px);
    font-weight: 800;
    line-height: 1.03;
    letter-spacing: -0.02em;
}

/* ---- Field grid -------------------------------------------------------- */
/* Gravity's own 12-column grid is deliberately LEFT IN PLACE: its
   `--width-half` (span 6) / `--width-full` (span 12) spans already produce
   exactly the approved two-up layout — name and email side by side, phone
   full width. Overriding grid-template-columns here would fight an
   id-scoped rule and break those spans, so only the gutters are set.
   The hidden and honeypot fields are taken out of flow below so they cannot
   occupy a cell; display:none inputs are still submitted, so the honeypot
   keeps working. */
.bookconsul:not(.tk-consult-section) .gform_fields {
    row-gap: 16px;
}

.bookconsul:not(.tk-consult-section) .gfield--type-hidden,
.bookconsul:not(.tk-consult-section) .gform_hidden,
.bookconsul:not(.tk-consult-section) .gfield--type-honeypot,
.bookconsul:not(.tk-consult-section) .gform_validation_container {
    display: none;
}

.bookconsul:not(.tk-consult-section) .gfield--width-full {
    grid-column: 1 / -1;
}

.bookconsul:not(.tk-consult-section) .gfield {
    margin: 0;
    padding: 0;
}

.bookconsul:not(.tk-consult-section) .ginput_container {
    margin: 0;
}

/* ---- Inputs ------------------------------------------------------------ */
/* :not(.iti__search-input) matters — the country-search box is an <input>
   inside this wrapper, and without the exclusion it inherits the field
   styling and renders as a stray pill under the phone box. */
.bookconsul:not(.tk-consult-section) .gfield input:not(.iti__search-input):not([type="submit"]):not([type="hidden"]),
.bookconsul:not(.tk-consult-section) .gfield select {
    width: 100%;
    min-height: 54px;
    padding: 0 18px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    /* !important on the radius only: the legacy sheet pins these inputs to a
       50px pill with !important, which specificity alone cannot beat —
       verified by injecting the identical selector last and watching it lose
       without !important and win with it. Every other property here lands
       normally. */
    border-radius: 10px !important;
    background: #FFFFFF;
    color: #14161A;
    font-size: 15.5px;
    line-height: 1.2;
    outline: none;
    /* border-color is deliberately NOT transitioned: Chromium does not
       re-resolve a transitioned property when a live theme toggle changes
       which rule matches, so the field would keep the previous theme's
       border until the next reload. Only the focus ring animates. */
    transition: box-shadow 0.18s ease;
}

.bookconsul:not(.tk-consult-section) .gfield input::placeholder {
    color: #7A828B;
    opacity: 1;
}

.bookconsul:not(.tk-consult-section) .gfield input:not(.iti__search-input):not([type="submit"]):focus,
.bookconsul:not(.tk-consult-section) .gfield select:focus {
    border-color: var(--primary-color, #0073FC);
    box-shadow: 0 0 0 3px rgba(0, 115, 252, 0.18);
}

/* Gravity marks an invalid field on its wrapper */
.bookconsul:not(.tk-consult-section) .gfield_error input:not(.iti__search-input):not([type="submit"]),
.bookconsul:not(.tk-consult-section) .gfield_error select {
    border-color: #FF6262;
}

.bookconsul:not(.tk-consult-section) .validation_message,
.bookconsul:not(.tk-consult-section) .gfield_validation_message {
    display: block;
    margin: 5px 4px 0;
    padding: 0;
    border: 0;
    background: 0 0;
    color: #FF8585;
    font-size: 12px;
}

/* the labels stay in the markup for screen readers; Gravity's hidden_label
   is honoured rather than re-implemented */
.bookconsul:not(.tk-consult-section) .hidden_label > .gfield_label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Submit ------------------------------------------------------------ */
.bookconsul:not(.tk-consult-section) .gform_footer {
    margin: 0;
    padding: 0;
}

.bookconsul:not(.tk-consult-section) .gform_button,
.bookconsul:not(.tk-consult-section) .consultation-submit {
    width: 100%;
    min-height: 54px;
    margin-top: 18px;
    padding: 0 24px;
    border: 0;
    /* same legacy !important pill as the inputs above */
    border-radius: 10px !important;
    background: linear-gradient(var(--primary-color, #0073FC), var(--primary-color-dark, #005BC7));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 12px rgba(0, 115, 252, 0.26);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* The label stays readable in every state — this is the exact failure that
   made the review CTAs invisible, so it is pinned explicitly. */
.bookconsul:not(.tk-consult-section) .gform_button,
.bookconsul:not(.tk-consult-section) .gform_button:hover,
.bookconsul:not(.tk-consult-section) .gform_button:focus,
.bookconsul:not(.tk-consult-section) .gform_button:active {
    color: #FFFFFF;
    -webkit-text-fill-color: #FFFFFF;
}

.bookconsul:not(.tk-consult-section) .gform_button:hover {
    background: linear-gradient(var(--primary-color-light, #66ACFF), var(--primary-color, #0073FC));
    transform: translateY(-1px);
}

/* ---- Artwork ----------------------------------------------------------- */
.bookconsul:not(.tk-consult-section) .consultantimg img,
.bookconsul:not(.tk-consult-section) .row.gy-4.align-items-center > [class*="col-"] > img {
    width: 100%;
    max-width: 340px;
    height: auto;
}

/* ---- intl-tel-input ---------------------------------------------------- */
/* Theming only. Positioning, show/hide and the mobile fullscreen popup are
   the library's own, restored by tbtk-intl-tel-input-base.css — nothing here
   re-implements them, which is what broke the dropdown once before. */
.bookconsul:not(.tk-consult-section) .iti {
    display: block;
    width: 100%;
    --iti-arrow-color: #6B7480;
    --iti-dialcode-color: #6B7480;
    --iti-hover-color: rgba(0, 115, 252, 0.10);
}

.bookconsul:not(.tk-consult-section) .iti__dropdown-content {
    border-radius: 12px;
}

/* ==========================================================================
   LIGHT MODE — uses the project's existing html[data-tk-theme="light"]
   ========================================================================== */
html[data-tk-theme="light"] section.bookconsul:not(.tk-consult-section) {
    background-color: #EDF1F4;
    background-image: none;
}

html[data-tk-theme="light"] .bookconsul:not(.tk-consult-section) .row.gy-4.align-items-center {
    border-color: rgba(15, 23, 42, 0.08);
    background: linear-gradient(#FFFFFF, #F8FAFB);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 26px rgba(15, 23, 42, 0.09);
}

html[data-tk-theme="light"] .bookconsul:not(.tk-consult-section) .consultantform .main-title,
html[data-tk-theme="light"] .bookconsul:not(.tk-consult-section) .consultantform h2.main-title {
    color: #0A0D0F;
}

html[data-tk-theme="light"] .bookconsul:not(.tk-consult-section) .gfield input:not(.iti__search-input):not([type="submit"]):not([type="hidden"]),
html[data-tk-theme="light"] .bookconsul:not(.tk-consult-section) .gfield select {
    border-color: rgba(15, 23, 42, 0.16);
    background: #FFFFFF;
    color: #14161A;
}

html[data-tk-theme="light"] .bookconsul:not(.tk-consult-section) .validation_message,
html[data-tk-theme="light"] .bookconsul:not(.tk-consult-section) .gfield_validation_message {
    color: #D63B3B;
}

/* ==========================================================================
   RESPONSIVE — mirrors the approved homepage breakpoints
   ========================================================================== */
@media (max-width: 991px) {
    .bookconsul:not(.tk-consult-section) .consultantform .main-title,
    .bookconsul:not(.tk-consult-section) .consultantform h2.main-title {
        max-width: 100%;
        font-size: clamp(28px, 5vw, 40px);
    }

    /* Between 768 and 991 the form still shares the card with the artwork,
       so a two-up grid inside it leaves ~138px per field. One column down. */
    .bookconsul:not(.tk-consult-section) .gform_fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 767px) {
    .bookconsul:not(.tk-consult-section) .row.gy-4.align-items-center {
        margin: 0 12px;
        padding: 24px 18px 26px;
        border-radius: 20px;
    }

    .bookconsul:not(.tk-consult-section) .consultantform .main-title,
    .bookconsul:not(.tk-consult-section) .consultantform h2.main-title {
        margin: 0 0 18px;
        font-size: clamp(26px, 7vw, 34px);
    }

    /* the artwork must not crush the form on a phone */
    .bookconsul:not(.tk-consult-section) .consultantimg img,
    .bookconsul:not(.tk-consult-section) .row.gy-4.align-items-center > [class*="col-"] > img {
        max-width: 220px;
        margin: 0 auto;
    }

    .bookconsul:not(.tk-consult-section) .iti__dropdown-content {
        max-width: calc(100vw - 24px);
    }
}
