/**
 * AmSpa Events — checkout custom layer.
 *
 * Layout/spacing utilities come from the Tailwind Play CDN (enqueued in
 * Frontend::enqueue_assets with the AmSpa color config). This file holds
 * everything the utilities can't: brand atmosphere (hero band), form
 * controls, option chips, stepper, async states, and animations.
 * Design source: web-designer/designs/event_checkout mockup.
 */

/* ---- page base ------------------------------------------------------- */
html { scroll-behavior: smooth; }

body.amspa-checkout-body {
    margin: 0;
    background: #f4f5f4;
    color: #2A3340;
    font-family: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ---- entrance animations --------------------------------------------- */
@keyframes amspa-fade-up {
    0%   { opacity: 0; transform: translateY(18px); }
    100% { opacity: 1; transform: none; }
}
@keyframes amspa-fade-in {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes amspa-float-slow {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(0, -22px, 0); }
}
.amspa-fade-up { animation: amspa-fade-up .8s cubic-bezier(.22, 1, .36, 1) both; }
.amspa-fade-in { animation: amspa-fade-in 1s ease both; }
.amspa-float   { animation: amspa-float-slow 14s ease-in-out infinite; }
.amspa-d1 { animation-delay: .05s; }
.amspa-d2 { animation-delay: .14s; }
.amspa-d3 { animation-delay: .24s; }
.amspa-d4 { animation-delay: .36s; }
.amspa-d5 { animation-delay: .48s; }
.amspa-d6 { animation-delay: .60s; }
.amspa-d7 { animation-delay: .72s; }

/* ---- hero atmosphere -------------------------------------------------- */
.amspa-hero-band {
    background:
        radial-gradient(120% 140% at 12% 0%, rgba(50, 171, 223, .55) 0%, rgba(50, 171, 223, 0) 45%),
        radial-gradient(120% 120% at 100% 8%, rgba(158, 199, 70, .30) 0%, rgba(158, 199, 70, 0) 42%),
        linear-gradient(160deg, #0C5D9D 0%, #0a4f87 55%, #083f6e 100%);
}
.amspa-hero-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(120% 90% at 30% 0%, #000 30%, transparent 78%);
            mask-image: radial-gradient(120% 90% at 30% 0%, #000 30%, transparent 78%);
}
.amspa-glow { filter: blur(46px); border-radius: 9999px; }
.amspa-wordmark { letter-spacing: -.02em; }

/* The active theme's stylesheet (Avada on www) still loads via wp_head and
   sets its own h1/anchor colors — force the hero copy back to white. */
body.amspa-checkout-body .amspa-hero-band h1,
body.amspa-checkout-body .amspa-hero-band a,
body.amspa-checkout-body .amspa-hero-band .amspa-wordmark {
    color: #ffffff !important;
}

/* ---- card accent rail (blue → light-blue → green top bar) ------------- */
.amspa-card-rail { position: relative; }
.amspa-card-rail::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(to right, #0C5D9D, #32ABDF, #9EC746);
    z-index: 1;
}

/* ---- form controls ----------------------------------------------------- */
.amspa-lbl {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #6D6F71;
    margin-bottom: 6px;
}
.amspa-req { color: #f87171; font-weight: 600; }
.amspa-help {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #999999;
    margin-top: 6px;
}

.amspa-field {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.amspa-field:focus {
    border-color: #32ABDF;
    box-shadow: 0 0 0 2px rgba(50, 171, 223, .2);
}
.amspa-field::placeholder { color: #9ca3af; }
.amspa-field.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, .15);
}

/* group-level highlight for invalid chip groups (radio/yesno) — the actual
   inputs are visually hidden, so the fieldset carries the error state */
.amspa-group-invalid .amspa-opt-chip {
    border-color: #ef4444;
}
.amspa-group-invalid > .amspa-lbl,
.amspa-group-invalid > legend.amspa-lbl {
    color: #dc2626;
}
select.amspa-field {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236D6F71' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .8rem center;
    cursor: pointer;
}

/* ---- option chips (radio / checkbox / yesno) --------------------------- */
.amspa-opt { position: relative; display: block; }
.amspa-opt input {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.amspa-opt-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #374151;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.amspa-opt-chip:hover {
    border-color: rgba(50, 171, 223, .7);
    background: rgba(239, 246, 255, .4);
}
.amspa-opt-dot,
.amspa-opt-box {
    display: grid;
    place-items: center;
    width: 16px; height: 16px;
    border: 2px solid #d1d5db;
    font-size: 8px;
    color: transparent;
    flex-shrink: 0;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.amspa-opt-dot { border-radius: 9999px; }
.amspa-opt-box { border-radius: 4px; font-size: 9px; }
.amspa-opt input:checked + .amspa-opt-chip {
    border-color: #0C5D9D;
    background: rgba(239, 246, 255, .7);
    color: #0C5D9D;
    font-weight: 500;
    box-shadow: inset 0 0 0 1px #0C5D9D;
}
.amspa-opt input:checked + .amspa-opt-chip .amspa-opt-dot,
.amspa-opt input:checked + .amspa-opt-chip .amspa-opt-box {
    border-color: #0C5D9D;
    background: #0C5D9D;
    color: #fff;
}
.amspa-opt input:focus-visible + .amspa-opt-chip {
    box-shadow: 0 0 0 2px rgba(50, 171, 223, .4);
}
.amspa-opt-center .amspa-opt-chip { justify-content: center; }

/* compact variant (per-attendee questionnaires) */
.amspa-opt-sm .amspa-opt-chip {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    gap: 6px;
}
.amspa-opt-sm .amspa-opt-dot,
.amspa-opt-sm .amspa-opt-box { width: 14px; height: 14px; }
.amspa-opt-sm .amspa-field { padding: 8px 12px; font-size: 13px; }
.amspa-opt-sm select.amspa-field { padding-right: 30px; }

/* ---- verify buttons + async result lines ------------------------------- */
.amspa-verify-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #0C5D9D;
    color: #0C5D9D;
    background: #fff;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}
.amspa-verify-btn:hover:not(:disabled) { background: #0C5D9D; color: #fff; }
.amspa-verify-btn:disabled { opacity: .6; cursor: default; }
.amspa-verify-btn-spinner,
.amspa-submit-spinner {
    display: none;
    width: 12px; height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 9999px;
    animation: amspa-spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes amspa-spin { to { transform: rotate(360deg); } }
.amspa-verify-btn.is-loading .amspa-verify-btn-spinner { display: inline-block; }

.amspa-verify-result {
    margin-top: 6px;
    min-height: 18px;
    font-size: 11px;
    line-height: 1.5;
    color: #6D6F71;
    white-space: pre-wrap;
}
.amspa-verify-result::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 5px;
}
.amspa-verify-result.is-hint    { color: #999999; }
.amspa-verify-result.is-hint::before    { content: '\f059'; font-weight: 400; } /* circle-question */
.amspa-verify-result.is-success { color: #15803d; font-weight: 500; }
.amspa-verify-result.is-success::before { content: '\f058'; } /* circle-check */
.amspa-verify-result.is-error   { color: #dc2626; }
.amspa-verify-result.is-error::before   { content: '\f057'; } /* circle-xmark */
.amspa-verify-result.is-warn    { color: #b45309; }
.amspa-verify-result.is-warn::before    { content: '\f071'; } /* triangle-exclamation */
.amspa-verify-result.is-info    { color: #6D6F71; }
.amspa-verify-result.is-info::before    { content: '\f05a'; } /* circle-info */
.amspa-verify-result:empty::before { content: none; }

/* ---- shimmer CTA -------------------------------------------------------- */
.amspa-cta-sheen {
    background-image: linear-gradient(100deg, #0C5D9D 0%, #0C5D9D 40%, #1274bd 50%, #0C5D9D 60%, #0C5D9D 100%);
    background-size: 220% 100%;
    background-position: 100% 0;
    transition: background-position .6s ease, box-shadow .15s ease, transform .15s ease;
}
.amspa-cta-sheen:hover { background-position: 0 0; }

.amspa-submit {
    border: 0;
    font-family: inherit;
}
.amspa-submit:hover { box-shadow: 0 20px 45px -14px rgba(12, 93, 157, .45); }
.amspa-submit.is-loading .amspa-submit-spinner { display: inline-block; }
.amspa-submit:disabled { opacity: .65; cursor: default; transform: none; }

/* ---- form status message + debug ---------------------------------------- */
.amspa-message {
    display: none;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}
.amspa-message.is-success {
    display: block;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}
.amspa-message.is-error {
    display: block;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}
.amspa-debug {
    margin-top: 16px;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    padding: 14px 18px;
    background: #fff;
    overflow-x: auto;
}
.amspa-debug h3 { margin: 0 0 8px; font-size: 12px; color: #6D6F71; }
.amspa-debug pre { margin: 0; font-size: 11px; line-height: 1.5; }

/* ---- progress stepper ---------------------------------------------------- */
.amspa-step a { text-decoration: none; }
.amspa-step-dot {
    display: grid;
    place-items: center;
    width: 28px; height: 28px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    background: #f3f4f6;
    color: #6D6F71;
    box-shadow: inset 0 0 0 1px #e5e7eb;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.amspa-step.is-active .amspa-step-dot {
    background: #0C5D9D;
    color: #fff;
    box-shadow: 0 4px 10px -2px rgba(12, 93, 157, .4);
}
.amspa-step.is-active .amspa-step-label { color: #0C5D9D; }
.amspa-step.is-active .amspa-step-icon { color: #0C5D9D; }
.amspa-step-line {
    height: 1px;
    flex: 1;
    background: #e5e7eb;
    min-width: 12px;
}

/* ---- details / chevrons --------------------------------------------------- */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary .amspa-chev { transform: rotate(180deg); }
.amspa-chev { transition: transform .25s ease; }

/* ---- attendee block status pill -------------------------------------------- */
.amspa-att-status {
    color: #999999;
    background: #fff;
    border: 1px solid #e5e7eb;
}
.amspa-att-status.is-ready {
    color: #15803d;
    background: rgba(158, 199, 70, .15);
    border-color: rgba(158, 199, 70, .3);
}

/* ---- sidebar: tier badge + pricing highlight -------------------------------- */
.amspa-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
    padding: 4px 10px;
    background: #f3f4f6;
    color: #4b5563;
    transition: background-color .2s ease, color .2s ease;
}
.amspa-tier-badge.is-member {
    background: rgba(158, 199, 70, .15);
    color: #15803d;
}
.amspa-pricing-tier.is-active {
    background: rgba(239, 246, 255, .7);
    box-shadow: inset 0 0 0 1px rgba(12, 93, 157, .4);
}

/* ---- order summary included-content styling ---------------------------------- */
.amspa-summary-included ul { list-style: none; margin: 0; padding: 0; }
.amspa-summary-included li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    line-height: 1.5;
}
.amspa-summary-included li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #9EC746;
    position: absolute;
    left: 0;
    top: 1px;
    font-size: 10px;
}
.amspa-summary-included p { margin: 0 0 8px; }

/* ---- footer note (admin fine print) ------------------------------------------- */
.amspa-footer-note p { margin: 0 0 6px; }
.amspa-footer-note p:last-child { margin-bottom: 0; }

/* ---- autofill decoys — visually gone, still autofillable ------------------------ */
.amspa-autofill-decoy {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* ---- sticky stepper (mobile) -------------------------------------------------------
   The stepper is `sticky lg:static`: on <lg it pins 8px below the top of
   the viewport once scrolled past; checkout.js adds .is-stuck for the
   elevated look while pinned. Desktop keeps it in normal flow. */
.amspa-stepper { top: 8px; }
body.admin-bar .amspa-stepper { top: 54px; }   /* WP admin bar (46px mobile) */
@media (min-width: 783px) {
    body.admin-bar .amspa-stepper { top: 40px; } /* admin bar shrinks to 32px */
}
.amspa-stepper.is-stuck {
    background: rgba(255, 255, 255, .95);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
    box-shadow: 0 10px 30px -8px rgba(12, 93, 157, .18), 0 4px 10px -4px rgba(15, 46, 71, .10);
}

/* ---- reduced motion --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    .amspa-fade-up, .amspa-fade-in { opacity: 1 !important; transform: none !important; }
}

/* ====================================================================================
   MSS BRAND (medicalspashow.com) — strictly black & white / grayscale skin.
   The Tailwind amspa-* palette is already remapped to grays in
   Frontend::enqueue_assets; these overrides cover everything this file and
   the standard Tailwind color utilities hard-code in AmSpa blue/green.
   Palette source: mss2027 theme splash.css.
   ==================================================================================== */
body.amspa-brand-mss .amspa-hero-band {
    background: linear-gradient(160deg, #000000 0%, #111111 60%, #000000 100%);
}
body.amspa-brand-mss .amspa-card-rail::before {
    background: linear-gradient(to right, #000000, #4a4a4a, #b4b4b4);
}
body.amspa-brand-mss .amspa-field:focus {
    border-color: #6c6768;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .12);
}
body.amspa-brand-mss .amspa-req { color: #111111; }
body.amspa-brand-mss .amspa-opt-chip:hover {
    border-color: #8a8a8a;
    background: #f7f7f7;
}
body.amspa-brand-mss .amspa-opt input:checked + .amspa-opt-chip {
    border-color: #000000;
    background: #f1f1f1;
    color: #111111;
    box-shadow: inset 0 0 0 1px #000000;
}
body.amspa-brand-mss .amspa-opt input:checked + .amspa-opt-chip .amspa-opt-dot,
body.amspa-brand-mss .amspa-opt input:checked + .amspa-opt-chip .amspa-opt-box {
    border-color: #000000;
    background: #000000;
}
body.amspa-brand-mss .amspa-opt input:focus-visible + .amspa-opt-chip {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .3);
}
body.amspa-brand-mss .amspa-verify-btn {
    border-color: #000000;
    color: #000000;
}
body.amspa-brand-mss .amspa-verify-btn:hover:not(:disabled) {
    background: #000000;
    color: #fff;
}
body.amspa-brand-mss .amspa-verify-result.is-success { color: #111111; }
body.amspa-brand-mss .amspa-verify-result.is-error   { color: #111111; font-weight: 600; }
body.amspa-brand-mss .amspa-verify-result.is-warn    { color: #4a4a4a; }
body.amspa-brand-mss .amspa-cta-sheen {
    background-image: linear-gradient(100deg, #000000 0%, #000000 40%, #2a2a2a 50%, #000000 60%, #000000 100%);
}
body.amspa-brand-mss .amspa-submit:hover { box-shadow: 0 20px 45px -14px rgba(0, 0, 0, .5); }
body.amspa-brand-mss .amspa-message.is-success {
    background: #f1f1f1;
    border-color: #d6d6d6;
    color: #111111;
}
body.amspa-brand-mss .amspa-message.is-error {
    background: #f7f7f7;
    border-color: #4a4a4a;
    color: #111111;
}
body.amspa-brand-mss .amspa-step.is-active .amspa-step-dot {
    background: #000000;
    box-shadow: 0 4px 10px -2px rgba(0, 0, 0, .4);
}
body.amspa-brand-mss .amspa-step.is-active .amspa-step-label { color: #000000; }
body.amspa-brand-mss .amspa-step.is-active .amspa-step-icon { color: #000000; }
body.amspa-brand-mss .amspa-field.is-invalid {
    border-color: #111111;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .18);
}
body.amspa-brand-mss .amspa-group-invalid .amspa-opt-chip { border-color: #111111; }
body.amspa-brand-mss .amspa-group-invalid > .amspa-lbl,
body.amspa-brand-mss .amspa-group-invalid > legend.amspa-lbl { color: #111111; font-weight: 700; }
body.amspa-brand-mss .amspa-stepper.is-stuck {
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .22), 0 4px 10px -4px rgba(0, 0, 0, .12);
}
body.amspa-brand-mss .amspa-att-status.is-ready {
    color: #ffffff;
    background: #000000;
    border-color: #000000;
}
body.amspa-brand-mss .amspa-tier-badge.is-member {
    background: #000000;
    color: #ffffff;
}
body.amspa-brand-mss .amspa-pricing-tier.is-active {
    background: #f1f1f1;
    box-shadow: inset 0 0 0 1px #000000;
}
body.amspa-brand-mss .amspa-summary-included li::before { color: #111111; }

/* standard Tailwind color utilities used in the shared markup */
body.amspa-brand-mss .bg-blue-50,
body.amspa-brand-mss .bg-blue-50\/60,
body.amspa-brand-mss .bg-blue-50\/70 { background-color: #f1f1f1; }
body.amspa-brand-mss .border-blue-100 { border-color: #e8e8e8; }
body.amspa-brand-mss .text-green-700 { color: #111111; }
body.amspa-brand-mss .bg-red-50 { background-color: #f7f7f7; }
body.amspa-brand-mss .hover\:border-red-300:hover { border-color: #8a8a8a; }
body.amspa-brand-mss .hover\:text-red-500:hover { color: #111111; }
body.amspa-brand-mss .hover\:bg-red-50:hover { background-color: #f1f1f1; }

/* card-brand marks in a descending gray ramp instead of brand colors */
body.amspa-brand-mss .fa-cc-visa       { color: #111111 !important; }
body.amspa-brand-mss .fa-cc-amex       { color: #4a4a4a !important; }
body.amspa-brand-mss .fa-cc-discover   { color: #6c6768 !important; }
body.amspa-brand-mss .fa-cc-mastercard { color: #8a8a8a !important; }

/* Lato body / Poppins display, per the MSS splash */
body.amspa-brand-mss {
    font-family: 'Lato', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: #111111;
}
body.amspa-brand-mss h1,
body.amspa-brand-mss h2,
body.amspa-brand-mss h3,
body.amspa-brand-mss .amspa-step-label,
body.amspa-brand-mss .amspa-submit {
    font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif;
}
