/* ==========================================================
   KMD — CLUB SHOP ENQUIRY MODAL
   Gravity Forms ID 1 | Start a Club Shop page only.

   Native <dialog> handles modal semantics, Escape and focus
   containment. Opening motion is deliberately CSS-only so
   it cannot interfere with the page's existing GSAP timelines.
   ========================================================== */

/* 1. Dialog shell: compact, centred and scrollable when needed. */
.kmd-enquiry {
    box-sizing: border-box;
    width: min(92vw, 680px);
    max-width: 680px;
    max-height: min(88dvh, 840px);
    margin: auto;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #111315;
    color: #fff;
    border: 1px solid rgb(255 255 255 / 18%);
    border-top: 4px solid #e32026;
    border-radius: 3px;
    box-shadow: 0 2rem 6rem rgb(0 0 0 / 55%);
    /* Allow scrolling without displaying a flashing scrollbar. */
    scrollbar-width: none;
}

/* Hide the scrollbar in Chromium and WebKit as well. */
.kmd-enquiry::-webkit-scrollbar {
    display: none;
}

.kmd-enquiry::backdrop {
    background: rgb(0 0 0 / 78%);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.kmd-enquiry__panel {
    position: relative;
    padding: clamp(1.35rem, 3vw, 2.25rem);
}

/* 2. A restrained entrance: backdrop fades, content rises gently. */
.kmd-enquiry[open]::backdrop {
    animation: kmd-enquiry-backdrop-in 240ms ease-out both;
}

.kmd-enquiry[open] .kmd-enquiry__panel {
    animation: kmd-enquiry-panel-in 650ms cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes kmd-enquiry-backdrop-in {
    from { background-color: rgb(0 0 0 / 0%); }
    to   { background-color: rgb(0 0 0 / 78%); }
}

@keyframes kmd-enquiry-panel-in {
    from { opacity: 0; transform: translateY(16px) scale(.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 3. Close control: clear hit target and intentional focus state. */
.kmd-enquiry__close {
    position: absolute;
    z-index: 3;
    top: .65rem;
    right: .65rem;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: #202326;
    color: #fff;
    border: 1px solid rgb(255 255 255 / 25%);
    border-radius: 0;
    box-shadow: none;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease;
}

.kmd-enquiry__close:hover {
    background: #e32026;
    border-color: #e32026;
}

.kmd-enquiry__close:focus-visible {
    outline: 2px solid #f04449;
    outline-offset: 2px;
}

/* 4. Header: tighter hierarchy, space reserved for close control. */
.kmd-enquiry__eyebrow {
    margin: 0 3.2rem .6rem 0;
    color: #f04449;
    font-family: Inter, sans-serif;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .14em;
    line-height: 1.4;
    text-transform: uppercase;
}

.kmd-enquiry__title {
    max-width: 18ch;
    margin: 0 3rem .55rem 0;
    color: #fff;
    font-family: Poppins, sans-serif;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.08;
}

.kmd-enquiry__title span {
    color: #e32026;
}

.kmd-enquiry__intro {
    margin: 0 0 1.15rem;
    color: rgb(255 255 255 / 76%);
    font-family: Inter, sans-serif;
    font-size: .88rem;
    line-height: 1.55;
}

/* 5. Gravity Forms ID 1: readable, evenly spaced fields. */
.kmd-enquiry #gform_wrapper_1 {
    --gf-form-gap-y: .9rem;
    --gf-form-gap-x: 1rem;
    margin: 0;
    color: #fff;
    font-family: Inter, sans-serif;
}

.kmd-enquiry #gform_wrapper_1 .gform_fields {
    row-gap: .85rem;
    column-gap: 1rem;
}

.kmd-enquiry #gform_wrapper_1 .gfield {
    margin-block: 0;
}

.kmd-enquiry #gform_wrapper_1 :is(label, legend) {
    color: #fff;
    font-family: Inter, sans-serif;
}

.kmd-enquiry #gform_wrapper_1 .gfield_label {
    margin-bottom: .3rem;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.35;
}

.kmd-enquiry #gform_wrapper_1 .gfield_required {
    color: #f04449;
}

.kmd-enquiry #gform_wrapper_1 :is(input:not([type='submit']):not([type='checkbox']):not([type='radio']), textarea, select) {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.65rem;
    padding: .65rem .8rem;
    background: #f6f6f6;
    color: #17191b;
    border: 1px solid #cdd0d2;
    border-radius: 0;
    box-shadow: none;
    font-family: Inter, sans-serif;
    font-size: .84rem;
    line-height: 1.45;
}

.kmd-enquiry #gform_wrapper_1 input::placeholder,
.kmd-enquiry #gform_wrapper_1 textarea::placeholder {
    color: #666b71;
    opacity: 1;
}

/* Keep the message box useful without forcing a very tall dialog. */
.kmd-enquiry #gform_wrapper_1 textarea {
    height: 7.25rem;
    min-height: 7.25rem;
    max-height: 14rem;
    resize: vertical;
}

.kmd-enquiry #gform_wrapper_1 :is(input, select, textarea):focus-visible {
    outline: 2px solid #e32026;
    outline-offset: 2px;
}

/* Gravity Forms validation and confirmation remain legible on dark. */
.kmd-enquiry #gform_wrapper_1 :is(.gfield_description, .validation_message) {
    color: #ffd3d5;
}

.kmd-enquiry #gform_wrapper_1 .gform_validation_errors {
    color: #681519;
}

.kmd-enquiry .gform_confirmation_message {
    color: #fff;
    font-family: Inter, sans-serif;
    line-height: 1.6;
}

/* 6. Submit action: match the squared-off red hero buttons. */
.kmd-enquiry #gform_wrapper_1 .gform_footer {
    margin-top: 1rem;
    padding: 0;
}

.kmd-enquiry #gform_wrapper_1 .gform_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    margin: 0;
    padding: .8rem 1.4rem;
    background: #e32026;
    color: #fff;
    border: 1px solid #e32026;
    border-radius: 0;
    box-shadow: none;
    font-family: Inter, sans-serif;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.3;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease;
}

.kmd-enquiry #gform_wrapper_1 .gform_button:hover {
    background: #b9151b;
    border-color: #b9151b;
    transform: none;
}

.kmd-enquiry #gform_wrapper_1 .gform_button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}


/* ==========================================================
   7. SUBMISSION SUCCESS — KMD BRAND PANEL
   Gravity Forms confirmation is only returned after a valid
   successful submission. No inline styling is needed in PHP.
   ========================================================== */

/* Swap the introductory form heading for the dedicated success
   heading, but only once Gravity Forms displays confirmation. */
.kmd-enquiry__panel:has(.kmd-enquiry__success) > :is(
    .kmd-enquiry__eyebrow,
    .kmd-enquiry__title,
    .kmd-enquiry__intro
) {
    display: none;
}

.kmd-enquiry .gform_confirmation_wrapper,
.kmd-enquiry .gform_confirmation_message {
    margin: 0;
    color: #fff;
    font-family: Inter, sans-serif;
}

.kmd-enquiry .kmd-enquiry__success {
    max-width: 34rem;
    padding-block: .5rem .35rem;
    color: #fff;
    font-family: Inter, sans-serif;
    animation: kmd-enquiry-success-in 650ms cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes kmd-enquiry-success-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.kmd-enquiry__success-mark {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1.35rem;
    border: 2px solid #e32026;
    border-radius: 50%;
    background: rgb(227 32 38 / 9%);
    color: #f04449;
    font-family: Inter, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.kmd-enquiry__success-eyebrow {
    margin: 0 3rem .65rem 0;
    color: #f04449;
    font-family: Inter, sans-serif;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
    line-height: 1.4;
    text-transform: uppercase;
}

.kmd-enquiry__success-title {
    max-width: 18ch;
    margin: 0 2.25rem 1.1rem 0;
    color: #fff !important;
    font-family: Poppins, sans-serif;
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.12;
}

.kmd-enquiry__success-title span {
    color: #e32026;
}

.kmd-enquiry__success-text {
    max-width: 34rem;
    margin: 0 0 1rem;
    color: rgb(255 255 255 / 88%);
    font-family: Inter, sans-serif;
    font-size: .92rem;
    line-height: 1.65;
}

.kmd-enquiry__success-text--muted {
    margin-top: 1.15rem;
    color: rgb(255 255 255 / 65%);
}

.kmd-enquiry__success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    align-items: stretch;
    margin-top: 1.75rem;
}

.kmd-enquiry .kmd-enquiry__success-primary,
.kmd-enquiry .kmd-enquiry__success-secondary {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.1rem;
    margin: 0;
    padding: .85rem 1.2rem;
    border: 1px solid #e32026;
    border-radius: 0;
    box-shadow: none;
    font-family: Inter, sans-serif;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .035em;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.kmd-enquiry .kmd-enquiry__success-primary {
    background: #e32026;
    color: #fff;
}

.kmd-enquiry .kmd-enquiry__success-secondary {
    background: transparent;
    color: #fff;
    border-color: rgb(255 255 255 / 40%);
}

.kmd-enquiry .kmd-enquiry__success-primary:hover,
.kmd-enquiry .kmd-enquiry__success-primary:focus-visible {
    background: #b9151b;
    border-color: #b9151b;
    color: #fff;
}

.kmd-enquiry .kmd-enquiry__success-secondary:hover,
.kmd-enquiry .kmd-enquiry__success-secondary:focus-visible {
    background: #fff;
    border-color: #fff;
    color: #111315;
}

.kmd-enquiry .kmd-enquiry__success-primary:focus-visible,
.kmd-enquiry .kmd-enquiry__success-secondary:focus-visible {
    outline: 2px solid #f04449;
    outline-offset: 3px;
}

@media (max-width: 480px) {
    .kmd-enquiry__success-actions {
        flex-direction: column;
    }

    .kmd-enquiry .kmd-enquiry__success-primary,
    .kmd-enquiry .kmd-enquiry__success-secondary {
        width: 100%;
    }
}

/* 8. Small-screen fit, including on-screen keyboards. */
@media (max-width: 600px) {
    .kmd-enquiry {
        width: calc(100vw - 1rem);
        max-height: 94dvh;
    }

    .kmd-enquiry__panel {
        padding: 1.3rem 1rem 1.5rem;
    }

    .kmd-enquiry__title {
        font-size: clamp(1.6rem, 7vw, 2.1rem);
    }
}

/* 9. No entrance or control animations for reduced-motion users. */
@media (prefers-reduced-motion: reduce) {
    .kmd-enquiry[open]::backdrop,
    .kmd-enquiry[open] .kmd-enquiry__panel {
        animation: none;
    }

    .kmd-enquiry__close,
    .kmd-enquiry #gform_wrapper_1 .gform_button,
    .kmd-enquiry .kmd-enquiry__success-primary,
    .kmd-enquiry .kmd-enquiry__success-secondary {
        transition: none;
    }

    .kmd-enquiry .kmd-enquiry__success {
        animation: none;
    }
}

/* ==========================================================
   KMD CLUB SHOP — ANIMATED SUCCESS CONFIRMATION
   Red outline -> red tick -> green pass -> gentle pulse
   ========================================================== */

/* Replace the old static bordered tick. */
.kmd-enquiry__success-mark {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
}

/* SVG container and subtle completion pulse. */
.kmd-enquiry__success-svg {
    display: block;
    width: 52px;
    height: 52px;
    overflow: visible;

    animation:
        kmd-success-pulse 0.42s ease-out 1.02s both;
}

/* Common appearance of the circle and tick. */
.kmd-enquiry__success-ring,
.kmd-enquiry__success-tick {
    fill: none;
    stroke: #e6293b;
    stroke-width: 2.3;
    stroke-linecap: round;
    stroke-linejoin: round;

    /* SVG pathLength normalises both paths to 100. */
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

/* First: draw the circular outline in red. */
.kmd-enquiry__success-ring {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;

    animation:
        kmd-success-draw 0.50s ease-out 0s both,
        kmd-success-green 0.38s ease-in-out 0.84s both;
}

/* Second: draw the tick in red. */
.kmd-enquiry__success-tick {
    animation:
        kmd-success-draw 0.42s cubic-bezier(.22, 1, .36, 1)
            0.30s both,
        kmd-success-green 0.38s ease-in-out 0.84s both;
}

/* Draw the SVG paths progressively. */
@keyframes kmd-success-draw {
    from {
        stroke-dashoffset: 100;
    }

    to {
        stroke-dashoffset: 0;
    }
}

/* Change the red confirmation to green. */
@keyframes kmd-success-green {
    from {
        stroke: #e6293b;
    }

    to {
        stroke: #26bb72;
    }
}

/* Small finishing pulse — restrained, not bouncy. */
@keyframes kmd-success-pulse {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.075);
    }

    100% {
        transform: scale(1);
    }
}

/*
 * Accessibility:
 * Users requesting reduced motion see the completed
 * green success symbol immediately.
 */
@media (prefers-reduced-motion: reduce) {
    .kmd-enquiry__success-svg,
    .kmd-enquiry__success-ring,
    .kmd-enquiry__success-tick {
        animation: none !important;
    }

    .kmd-enquiry__success-ring,
    .kmd-enquiry__success-tick {
        stroke: #26bb72;
        stroke-dashoffset: 0;
    }
}

/* Keep privacy information readable and the policy link visibly identifiable. */
.kmd-enquiry__privacy { font-size: .875rem; line-height: 1.5; margin: 0 0 1.25rem; }
.kmd-enquiry__privacy a { text-decoration: underline; }
