/* ============================================================
   NadPoint Onboarding — Auth Modal
   One responsive design: centered card on desktop, true fullscreen
   takeover on mobile — not an admin-selectable layout skin. See
   class-ndp-onboarding-registry.php's docblock for why.
   ============================================================ */

#ndpob-overlay {
    --ndpob-accent: #0d9488;
    --ndpob-ink: #14181f;
    --ndpob-ink-soft: #667085;
    --ndpob-border: #e4e7ec;
    --ndpob-surface: #ffffff;
    --ndpob-surface-2: #f8f9fb;
    --ndpob-danger: #dc2626;
    --ndpob-danger-bg: #fef2f2;
    --ndpob-success: #16a34a;
    --ndpob-radius: 14px;
    --ndpob-shadow: 0 24px 70px rgba(20,24,31,.25);

    position: fixed; inset: 0; z-index: 99999;
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
#ndpob-overlay.is-open { display: block; }
#ndpob-overlay *, #ndpob-overlay *::before, #ndpob-overlay *::after { box-sizing: border-box; }

.ndpob-backdrop {
    position: absolute; inset: 0; background: rgba(15,18,24,.55);
    backdrop-filter: blur(3px);
    opacity: 0; transition: opacity .2s ease;
}
#ndpob-overlay.is-open .ndpob-backdrop { opacity: 1; }

.ndpob-modal {
    position: relative; z-index: 1;
    width: min(440px, calc(100vw - 32px));
    max-height: min(92vh, 780px);
    margin: 4vh auto;
    background: var(--ndpob-surface);
    border-radius: var(--ndpob-radius);
    box-shadow: var(--ndpob-shadow);
    padding: 34px 30px 28px;
    overflow-y: auto;
    transform: translateY(14px) scale(.98);
    opacity: 0;
    transition: transform .22s cubic-bezier(.2,.8,.3,1.1), opacity .18s ease;
}
#ndpob-overlay.is-open .ndpob-modal { transform: translateY(0) scale(1); opacity: 1; }

.ndpob-close {
    position: absolute; top: 16px; right: 16px; z-index: 2;
    width: 34px; height: 34px; border-radius: 50%; border: none;
    background: var(--ndpob-surface-2); color: var(--ndpob-ink-soft);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: background .15s;
}
.ndpob-close:hover { background: var(--ndpob-border); color: var(--ndpob-ink); }

.ndpob-brand { text-align: center; margin-bottom: 18px; }
.ndpob-brand img { max-height: 34px; width: auto; margin: 0 auto; }
.ndpob-brand-text { font-weight: 800; font-size: 1.15rem; color: var(--ndpob-ink); }

/* ───────────── Panels (state machine) ───────────── */
.ndpob-panel { display: none; }
.ndpob-panel.is-active { display: block; animation: ndpobFade .18s ease; }
@keyframes ndpobFade { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: translateX(0); } }

.ndpob-h1 { margin: 0 0 4px; font-size: 1.4rem; font-weight: 800; color: var(--ndpob-ink); letter-spacing: -.01em; text-align: center; }
.ndpob-sub { margin: 0 0 20px; font-size: .87rem; color: var(--ndpob-ink-soft); text-align: center; }
.ndpob-back { display: inline-flex; align-items: center; gap: 7px; border: none; background: none; color: var(--ndpob-ink-soft); font-size: .82rem; font-weight: 600; cursor: pointer; padding: 4px 0; margin-bottom: 10px; }
.ndpob-back:hover { color: var(--ndpob-ink); }

.ndpob-msg { display: none; font-size: .82rem; font-weight: 600; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }
.ndpob-msg.is-error { display: block; background: var(--ndpob-danger-bg); color: var(--ndpob-danger); }
.ndpob-msg.is-success { display: block; background: #ecfdf5; color: #15803d; }

/* ───────────── Role landing ───────────── */
.ndpob-role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ndpob-role-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 22px 10px; border: 1.5px solid var(--ndpob-border); border-radius: 12px;
    background: var(--ndpob-surface); cursor: pointer; transition: border-color .15s, transform .1s, background .15s;
}
.ndpob-role-btn:hover { border-color: var(--ndpob-accent); background: var(--ndpob-surface-2); transform: translateY(-2px); }
.ndpob-role-btn i { font-size: 1.4rem; color: var(--ndpob-accent); }
.ndpob-role-btn strong { font-size: .92rem; color: var(--ndpob-ink); }
.ndpob-role-btn span { font-size: .74rem; color: var(--ndpob-ink-soft); }

/* Style: list — compact vertical rows instead of a 2x2 grid; icon,
   label and description run horizontally, fits more roles without
   scrolling and reads closer to a native iOS/Android action sheet. */
.ndpob-role-style-list { grid-template-columns: 1fr; gap: 8px; }
.ndpob-role-style-list .ndpob-role-btn { flex-direction: row; justify-content: flex-start; text-align: left; padding: 14px 16px; gap: 14px; }
.ndpob-role-style-list .ndpob-role-btn i { font-size: 1.1rem; width: 22px; flex: 0 0 auto; }
.ndpob-role-style-list .ndpob-role-btn strong { font-size: .88rem; }
.ndpob-role-style-list .ndpob-role-btn span { display: block; }
.ndpob-role-style-list .ndpob-role-btn:hover { transform: translateX(3px); }

/* Style: minimal — text-first, no icons, quieter/editorial feel;
   underline-style rows rather than bordered cards. */
.ndpob-role-style-minimal { grid-template-columns: 1fr; gap: 2px; }
.ndpob-role-style-minimal .ndpob-role-btn { flex-direction: row; justify-content: space-between; text-align: left; padding: 15px 4px; gap: 10px; border: none; border-bottom: 1px solid var(--ndpob-border); border-radius: 0; background: none; }
.ndpob-role-style-minimal .ndpob-role-btn i { display: none; }
.ndpob-role-style-minimal .ndpob-role-btn strong { font-size: .92rem; order: 1; }
.ndpob-role-style-minimal .ndpob-role-btn span { font-size: .78rem; order: 2; }
.ndpob-role-style-minimal .ndpob-role-btn::after { content: "\2192"; margin-left: auto; color: var(--ndpob-ink-soft); order: 3; }
.ndpob-role-style-minimal .ndpob-role-btn:hover { transform: none; background: var(--ndpob-surface-2); border-color: var(--ndpob-accent); }

/* ───────────── Fields ───────────── */
.ndpob-field { margin-bottom: 14px; }
.ndpob-field label { display: block; font-size: .8rem; font-weight: 700; color: var(--ndpob-ink); margin-bottom: 6px; }
.ndpob-req { color: var(--ndpob-danger); }
.ndpob-input-wrap { position: relative; }
.ndpob-input-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ndpob-ink-soft); font-size: .82rem; }
.ndpob-input {
    width: 100%; padding: 11px 13px; border: 1.5px solid var(--ndpob-border); border-radius: 9px;
    font-size: .88rem; font-family: inherit; color: var(--ndpob-ink); background: var(--ndpob-surface);
    transition: border-color .15s, box-shadow .15s;
}
.ndpob-input.has-icon { padding-left: 38px; }
.ndpob-input:focus { outline: none; border-color: var(--ndpob-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ndpob-accent) 18%, transparent); }
.ndpob-field.has-error .ndpob-input { border-color: var(--ndpob-danger); }
textarea.ndpob-input { resize: vertical; min-height: 68px; padding-left: 13px; }
select.ndpob-input { padding-left: 13px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23667085' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 32px; }
.ndpob-error { display: none; color: var(--ndpob-danger); font-size: .74rem; margin: 5px 0 0; }
.ndpob-field.has-error .ndpob-error { display: block; }

.ndpob-eye { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); border: none; background: none; color: var(--ndpob-ink-soft); cursor: pointer; padding: 4px; }
.ndpob-checkbox-label { display: flex; align-items: flex-start; gap: 8px; font-size: .8rem; color: var(--ndpob-ink-soft); cursor: pointer; line-height: 1.4; }
.ndpob-checkbox-label input { margin-top: 2px; flex: 0 0 auto; }
.ndpob-tos a { color: var(--ndpob-accent); font-weight: 600; }
.ndpob-row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }

.ndpob-strength { height: 4px; background: var(--ndpob-border); border-radius: 3px; margin: 7px 0 4px; overflow: hidden; }
.ndpob-strength-bar { height: 100%; width: 0; border-radius: 3px; transition: width .2s, background .2s; }
.ndpob-strength[data-level="1"] .ndpob-strength-bar { width: 25%; background: #dc2626; }
.ndpob-strength[data-level="2"] .ndpob-strength-bar { width: 50%; background: #f59e0b; }
.ndpob-strength[data-level="3"] .ndpob-strength-bar { width: 75%; background: #3b82f6; }
.ndpob-strength[data-level="4"] .ndpob-strength-bar { width: 100%; background: #16a34a; }
.ndpob-hint { margin: 0; font-size: .72rem; color: var(--ndpob-ink-soft); }

.ndpob-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ───────────── File upload ───────────── */
.ndpob-file-drop {
    display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center;
    padding: 20px 12px; border: 1.5px dashed var(--ndpob-border); border-radius: 10px; cursor: pointer;
    background: var(--ndpob-surface-2); transition: border-color .15s;
}
.ndpob-file-drop:hover, .ndpob-file-drop.is-dragover { border-color: var(--ndpob-accent); }
.ndpob-file-drop i { font-size: 1.3rem; color: var(--ndpob-accent); }
.ndpob-file-drop-text { font-size: .78rem; color: var(--ndpob-ink-soft); }
.ndpob-file-drop-name { font-size: .78rem; font-weight: 700; color: var(--ndpob-ink); }
.ndpob-file-input { position: absolute; left: -9999px; }

/* ───────────── Buttons ───────────── */
.ndpob-submit {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px; border: none; border-radius: 10px; background: var(--ndpob-accent); color: #fff;
    font-size: .9rem; font-weight: 700; cursor: pointer; transition: filter .15s, transform .08s;
}
.ndpob-submit:hover { filter: brightness(.94); }
.ndpob-submit:active { transform: scale(.99); }
.ndpob-submit:disabled { opacity: .7; cursor: not-allowed; }
.ndpob-spinner { display: none; }
.ndpob-submit.is-loading .ndpob-spinner { display: inline-block; }
.ndpob-submit.is-loading span { display: none; }
.ndpob-btn-outline { padding: 12px 18px; border: 1.5px solid var(--ndpob-border); border-radius: 10px; background: #fff; color: var(--ndpob-ink); font-size: .87rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 7px; }
.ndpob-btn-outline:hover { border-color: var(--ndpob-ink-soft); }

.ndpob-google-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 11px; border: 1.5px solid var(--ndpob-border); border-radius: 10px; background: #fff;
    font-size: .86rem; font-weight: 700; color: var(--ndpob-ink); cursor: pointer; margin-bottom: 14px;
}
.ndpob-google-btn:hover { background: var(--ndpob-surface-2); }
.ndpob-google-btn i { color: #ea4335; }
.ndpob-divider { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; color: var(--ndpob-ink-soft); font-size: .74rem; }
.ndpob-divider::before, .ndpob-divider::after { content: ""; flex: 1; height: 1px; background: var(--ndpob-border); }

.ndpob-link-btn { border: none; background: none; color: var(--ndpob-accent); font-size: .8rem; font-weight: 600; cursor: pointer; padding: 0; }
.ndpob-link-btn:hover { text-decoration: underline; }
.ndpob-link-strong { font-weight: 800; }
.ndpob-switch { text-align: center; font-size: .82rem; color: var(--ndpob-ink-soft); margin: 16px 0 0; }

/* ───────────── Step wizard (vendor/rider signup, forgot password) ───────────── */
.ndpob-steps { display: flex; align-items: flex-start; justify-content: center; gap: 4px; margin-bottom: 22px; }
.ndpob-step-dot { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; max-width: 74px; position: relative; }
.ndpob-step-dot::before {
    content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--ndpob-border); z-index: 0;
}
.ndpob-step-dot:first-child::before { display: none; }
.ndpob-step-dot span {
    width: 24px; height: 24px; border-radius: 50%; background: var(--ndpob-surface-2); border: 1.5px solid var(--ndpob-border);
    display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; color: var(--ndpob-ink-soft);
    position: relative; z-index: 1; transition: all .15s;
}
.ndpob-step-dot small { font-size: .62rem; color: var(--ndpob-ink-soft); text-align: center; font-weight: 600; }
.ndpob-step-dot.is-active span { background: var(--ndpob-accent); border-color: var(--ndpob-accent); color: #fff; }
.ndpob-step-dot.is-active small { color: var(--ndpob-ink); }
.ndpob-step-dot.is-done span { background: var(--ndpob-success); border-color: var(--ndpob-success); color: #fff; }
.ndpob-step-dot.is-done::before { background: var(--ndpob-success); }

.ndpob-wizard-step { display: none; }
.ndpob-wizard-step.is-active { display: block; animation: ndpobFade .18s ease; }
.ndpob-wizard-nav { display: flex; gap: 10px; margin-top: 8px; }
.ndpob-wizard-nav .ndpob-btn-outline { display: none; }
.ndpob-wizard-nav .ndpob-btn-outline.is-visible { display: flex; }
.ndpob-wizard-nav .ndpob-submit { flex: 1; }

.ndpob-review { background: var(--ndpob-surface-2); border-radius: 10px; padding: 14px; margin-bottom: 16px; font-size: .82rem; }
.ndpob-review-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--ndpob-border); }
.ndpob-review-row:last-child { border-bottom: none; }
.ndpob-review-row span:first-child { color: var(--ndpob-ink-soft); }
.ndpob-review-row span:last-child { font-weight: 700; text-align: right; max-width: 60%; word-break: break-word; }

/* ───────────── OTP boxes ───────────── */
.ndpob-otp-boxes { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.ndpob-otp-box {
    width: 44px; height: 52px; text-align: center; font-size: 1.2rem; font-weight: 800;
    border: 1.5px solid var(--ndpob-border); border-radius: 10px; color: var(--ndpob-ink);
}
.ndpob-otp-box:focus { outline: none; border-color: var(--ndpob-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ndpob-accent) 18%, transparent); }

/* ───────────── Responsive: true fullscreen on mobile ───────────── */
@media (max-width: 560px) {
    .ndpob-modal { width: 100vw; height: 100vh; max-height: 100vh; margin: 0; border-radius: 0; padding: 24px 20px 30px; }
    .ndpob-role-grid { grid-template-columns: 1fr 1fr; }
    .ndpob-step-dot small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ndpob-modal, .ndpob-panel.is-active, .ndpob-wizard-step.is-active { animation: none; transition: none; }
}
