/**
 * Nursery360 — Native Registration Form
 * Modal + inline form styling, ported from the Sky Car Rental native-booking
 * popup (re-prefixed nwl-skyb-). Self-contained; sets explicit values so host
 * themes can't bleed in.
 */

.nwl-skyb-root {
    --nwl-bg: #ffffff;
    --nwl-fg: #0f1112;
    --nwl-muted: #5a6573;
    --nwl-border: #e4e7ec;
    --nwl-soft: #f6f8fa;
    --nwl-accent: #2a7d8c;
    --nwl-accent-fg: #ffffff;
    --nwl-error: #dc2626;
    --nwl-radius: 16px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--nwl-fg);
}
.nwl-skyb-root *, .nwl-skyb-root *::before, .nwl-skyb-root *::after { box-sizing: border-box; }

/* Defend against host-theme button/svg styling bleeding in (Woodmart et al.
   aggressively style bare <button>/<svg>). Reset everything, then our own
   rules below re-style intentionally. */
.nwl-skyb-root button {
    -webkit-appearance: none !important;
    appearance: none !important;
    font-family: inherit;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: normal !important;
    min-height: 0 !important;
    margin: 0;
    box-shadow: none;
    background-image: none !important;
}
.nwl-skyb-root svg { display: block; width: 100%; height: 100%; max-width: 100%; }

.nwl-skyb-theme-dark {
    --nwl-bg: #15171a;
    --nwl-fg: #f3f5f7;
    --nwl-muted: #9aa4b0;
    --nwl-border: #2c3036;
    --nwl-soft: #1d2024;
    --nwl-accent: #4db6c7;
    --nwl-accent-fg: #0b1416;
}

/* ── Overlay (popup only) ── */
.nwl-skyb-root:not(.nwl-skyb-inline) {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 17, 18, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: nwl-skyb-fade 0.2s ease;
}
@keyframes nwl-skyb-fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Shell (card) ── */
.nwl-skyb-shell {
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    background: var(--nwl-bg);
    border-radius: var(--nwl-radius);
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: nwl-skyb-rise 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.nwl-skyb-inline .nwl-skyb-shell {
    max-height: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--nwl-border);
    animation: none;
}
@keyframes nwl-skyb-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── Header + progress ── */
.nwl-skyb-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 20px;
    border-bottom: 1px solid var(--nwl-border);
}
.nwl-skyb-header__title {
    flex: 1;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: center;
}
.nwl-skyb-root .nwl-skyb-header__back, .nwl-skyb-root .nwl-skyb-header__close {
    width: 38px !important; height: 38px !important;
    flex-shrink: 0;
    border-radius: 999px !important;
    border: 1px solid var(--nwl-border) !important;
    background: var(--nwl-bg) !important;
    color: var(--nwl-fg) !important;
    display: grid !important; place-items: center;
    cursor: pointer;
    padding: 9px !important;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.nwl-skyb-header__back svg, .nwl-skyb-header__close svg { width: 20px; height: 20px; stroke: currentColor; }
.nwl-skyb-header__back:hover, .nwl-skyb-header__close:hover { background: var(--nwl-soft); border-color: var(--nwl-fg); }
.nwl-skyb-header__back[hidden] { visibility: hidden; }
.nwl-skyb-progress {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: var(--nwl-border);
}
.nwl-skyb-progress__fill {
    height: 100%;
    background: var(--nwl-accent);
    transition: width 0.3s ease;
}

/* ── Body / scroll area ── */
.nwl-skyb-body { flex: 1; min-height: 0; overflow: hidden; display: flex; }
.nwl-skyb-main {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 22px 20px;
}
.nwl-skyb-inline .nwl-skyb-main { overflow: visible; }

/* ── Fields grid ── */
.nwl-skyb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.nwl-skyb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nwl-skyb-field--full { grid-column: 1 / -1; }
.nwl-skyb-label { font-size: 13px; font-weight: 600; color: var(--nwl-fg); }
.nwl-skyb-req { color: var(--nwl-error); }
.nwl-skyb-input {
    width: 100%;
    font-size: 15px;
    font-family: inherit;
    color: var(--nwl-fg);
    background: var(--nwl-bg);
    border: 1px solid var(--nwl-border);
    border-radius: 10px;
    padding: 11px 13px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.nwl-skyb-input:focus {
    border-color: var(--nwl-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nwl-accent) 18%, transparent);
}
.nwl-skyb-select { appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235a6573' d='M6 8 0 2l1.4-1.4L6 5.2 10.6.6 12 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.nwl-skyb-select:disabled { cursor: not-allowed; opacity: 0.6; background-color: color-mix(in srgb, var(--nwl-border) 22%, var(--nwl-bg)); }
/* City "Other" free-text reveal sits directly under its select. */
#nwl-pobcity-other { margin-top: 8px; }
.nwl-skyb-field--error .nwl-skyb-input { border-color: var(--nwl-error); }
.nwl-skyb-field__err { font-size: 12px; color: var(--nwl-error); font-weight: 500; }
.nwl-skyb-fixed {
    font-size: 15px; font-weight: 600;
    padding: 11px 13px;
    background: var(--nwl-soft);
    border: 1px solid var(--nwl-border);
    border-radius: 10px;
}

/* ── Yes/No pills ── */
.nwl-skyb-yesno { display: flex; gap: 10px; }
.nwl-skyb-root .nwl-skyb-pill {
    flex: 0 0 auto;
    min-width: 84px;
    font-size: 14px; font-weight: 600;
    font-family: inherit;
    padding: 10px 18px !important;
    border-radius: 999px !important;
    border: 1px solid var(--nwl-border) !important;
    background: var(--nwl-bg) !important;
    color: var(--nwl-fg) !important;
    cursor: pointer;
    transition: all 0.15s ease;
}
.nwl-skyb-root .nwl-skyb-pill:hover { border-color: var(--nwl-fg) !important; }
.nwl-skyb-root .nwl-skyb-pill.is-active { background: var(--nwl-accent) !important; border-color: var(--nwl-accent) !important; color: var(--nwl-accent-fg) !important; }
.nwl-skyb-root .nwl-skyb-pill.is-booked {
    opacity: 0.5;
    cursor: not-allowed !important;
    color: var(--nwl-muted) !important;
    background: var(--nwl-soft) !important;
    text-decoration: line-through;
}
.nwl-skyb-root .nwl-skyb-pill.is-booked:hover { border-color: var(--nwl-border) !important; }

/* ── Hint text (e.g. slot-picker prompts) ── */
.nwl-skyb-hint { font-size: 14px; color: var(--nwl-muted); margin: 4px 0 0; }
.nwl-skyb-hint--full { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--nwl-fg); margin-bottom: 10px; }
.nwl-skyb-hint--full svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--nwl-accent); }

/* ── Availability calendar (date step) ── */
.nwl-skyb-root .nwl-cal {
    border: 1px solid var(--nwl-border);
    border-radius: 12px;
    padding: 12px;
    background: var(--nwl-bg);
    width: 100%;
    max-width: 100%;
}
.nwl-skyb-root .nwl-cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.nwl-skyb-root .nwl-cal__month { font-size: 15px; font-weight: 700; color: var(--nwl-fg); }
.nwl-skyb-root .nwl-cal__nav {
    width: 34px; height: 34px;
    border-radius: 9px !important;
    border: 1px solid var(--nwl-border) !important;
    background: var(--nwl-bg) !important;
    color: var(--nwl-fg) !important;
    font-size: 20px; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.nwl-skyb-root .nwl-cal__nav:hover:not(:disabled) { border-color: var(--nwl-fg) !important; }
.nwl-skyb-root .nwl-cal__nav:disabled { opacity: 0.35; cursor: not-allowed; }
.nwl-skyb-root .nwl-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.nwl-skyb-root .nwl-cal__weekdays { margin-bottom: 4px; }
.nwl-skyb-root .nwl-cal__wd { text-align: center; font-size: 11px; font-weight: 600; color: var(--nwl-muted); padding: 2px 0; text-transform: uppercase; letter-spacing: 0.03em; }
.nwl-skyb-root .nwl-cal__empty { height: 46px; }
.nwl-skyb-root .nwl-cal__day {
    height: 46px;
    width: 100%;
    border: 1px solid transparent !important;
    border-radius: 9px !important;
    background: var(--nwl-soft) !important;
    color: var(--nwl-fg) !important;
    font-family: inherit;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
    display: flex; align-items: center; justify-content: center;
}
.nwl-skyb-root .nwl-cal__day:hover:not(.is-disabled) { border-color: var(--nwl-accent) !important; }
.nwl-skyb-root .nwl-cal__day.is-today:not(.is-selected) { border-color: var(--nwl-accent) !important; }
.nwl-skyb-root .nwl-cal__day.is-selected { background: var(--nwl-accent) !important; border-color: var(--nwl-accent) !important; color: var(--nwl-accent-fg) !important; }
.nwl-skyb-root .nwl-cal__day.is-disabled,
.nwl-skyb-root .nwl-cal__day:disabled {
    background: transparent !important;
    color: var(--nwl-muted) !important;
    opacity: 0.32;
    cursor: not-allowed;
}

/* ── Check chips (preferred days) ── */
.nwl-skyb-checkgroup { display: flex; flex-wrap: wrap; gap: 8px; }
.nwl-skyb-root .nwl-skyb-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 500;
    padding: 8px 14px !important;
    border-radius: 999px !important;
    border: 1px solid var(--nwl-border) !important;
    background: var(--nwl-bg) !important;
    color: var(--nwl-fg) !important;
    cursor: pointer;
    transition: all 0.15s ease;
}
.nwl-skyb-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.nwl-skyb-root .nwl-skyb-chip.is-active { background: var(--nwl-accent) !important; border-color: var(--nwl-accent) !important; color: var(--nwl-accent-fg) !important; }

/* ── Declaration ── */
.nwl-skyb-declaration {
    display: flex; align-items: flex-start; gap: 12px;
    font-size: 14px; line-height: 1.5;
    padding: 14px 16px;
    background: var(--nwl-soft);
    border: 1px solid var(--nwl-border);
    border-radius: 12px;
    cursor: pointer;
}
.nwl-skyb-declaration input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; accent-color: var(--nwl-accent); cursor: pointer; }

/* ── Error banner ── */
.nwl-skyb-error {
    display: flex; align-items: center; gap: 10px;
    background: color-mix(in srgb, var(--nwl-error) 10%, var(--nwl-bg));
    color: var(--nwl-error);
    border: 1px solid color-mix(in srgb, var(--nwl-error) 30%, transparent);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px; font-weight: 500;
    margin-bottom: 18px;
}
.nwl-skyb-error svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Footer ── */
.nwl-skyb-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 20px;
    border-top: 1px solid var(--nwl-border);
    background: var(--nwl-bg);
}
.nwl-skyb-footer__step { font-size: 13px; color: var(--nwl-muted); font-weight: 500; }
.nwl-skyb-root .nwl-skyb-btn {
    font-family: inherit; font-size: 15px; font-weight: 700;
    border: none !important; border-radius: 10px !important;
    padding: 13px 28px !important;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.15s ease, background 0.15s ease;
}
.nwl-skyb-root .nwl-skyb-btn--primary { background: var(--nwl-accent) !important; color: var(--nwl-accent-fg) !important; }
.nwl-skyb-root .nwl-skyb-btn--primary:hover { background: color-mix(in srgb, var(--nwl-accent) 88%, #000) !important; }
.nwl-skyb-btn--primary:active { transform: scale(0.985); }
.nwl-skyb-btn:disabled, .nwl-skyb-btn.is-loading { opacity: 0.65; cursor: not-allowed; }

/* ── Success ── */
.nwl-skyb-success { text-align: center; padding: 48px 28px; }
.nwl-skyb-success__icon {
    width: 64px; height: 64px; margin: 0 auto 20px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--nwl-accent) 16%, var(--nwl-bg));
    color: var(--nwl-accent);
    display: grid; place-items: center; padding: 16px;
}
.nwl-skyb-success h3 { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.nwl-skyb-success p { font-size: 15px; color: var(--nwl-muted); margin: 0 0 22px; line-height: 1.6; }

/* ── Default trigger button (shortcode) ── */
.nwl-skyb-trigger {
    font-family: inherit; font-size: 15px; font-weight: 700;
    background: #2a7d8c; color: #fff;
    border: none; border-radius: 10px;
    padding: 13px 28px; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background 0.15s ease;
}
.nwl-skyb-trigger:hover { background: #226574; }
.nwl-skyb-trigger__icon { display: inline-flex; align-items: center; line-height: 0; }
.nwl-skyb-trigger__icon svg { width: 1em; height: 1em; fill: currentColor; }
.nwl-skyb-trigger__icon i { font-size: 1em; line-height: 1; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .nwl-skyb-root:not(.nwl-skyb-inline) { padding: 0; }
    /* 100dvh (with 100vh fallback) — on iOS Safari 100vh extends behind the
       browser toolbars, which buried the footer + Continue button. */
    .nwl-skyb-shell {
        max-width: 100%;
        max-height: 100vh; height: 100vh;
        max-height: 100dvh; height: 100dvh;
        border-radius: 0;
    }
    .nwl-skyb-root:not(.nwl-skyb-inline) .nwl-skyb-footer { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
    .nwl-skyb-grid { grid-template-columns: 1fr; }
    .nwl-skyb-field--full { grid-column: 1; }
}

/* ── Nursery confirmation popup (inline apply form) ── */
.nwl-skyb-root .nwl-skyb-confirm {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 17, 18, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: nwl-skyb-fade 0.2s ease;
}
.nwl-skyb-root .nwl-skyb-confirm__box {
    width: 100%;
    max-width: 440px;
    background: var(--nwl-bg);
    border: 1px solid var(--nwl-border);
    border-radius: var(--nwl-radius);
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
    padding: 32px 28px;
    text-align: center;
    animation: nwl-skyb-pop 0.2s ease;
}
@keyframes nwl-skyb-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.nwl-skyb-root .nwl-skyb-confirm__intro {
    margin: 0 0 10px;
    font-size: 15px;
    color: var(--nwl-muted);
}
.nwl-skyb-root .nwl-skyb-confirm__nursery {
    margin: 0 0 14px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--nwl-accent);
    letter-spacing: 0.01em;
}
.nwl-skyb-root .nwl-skyb-confirm__note {
    margin: 0 0 26px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--nwl-muted);
}
.nwl-skyb-root .nwl-skyb-confirm__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.nwl-skyb-root .nwl-skyb-confirm__actions .nwl-skyb-btn { flex: 1 1 auto; min-width: 150px; }
.nwl-skyb-root .nwl-skyb-confirm__back {
    background: transparent !important;
    color: var(--nwl-fg) !important;
    box-shadow: inset 0 0 0 1.5px var(--nwl-border) !important;
}
.nwl-skyb-root .nwl-skyb-confirm__back:hover {
    box-shadow: inset 0 0 0 1.5px var(--nwl-fg) !important;
}
@media (max-width: 420px) {
    .nwl-skyb-root .nwl-skyb-confirm__actions .nwl-skyb-btn { flex-basis: 100%; }
}
