/* HocWizard – Light theme. Dark variant: hocwizard_dark.css */

/* ── Variables ─────────────────────────────────────────────────── */
.hoc-wizard, .hoc-wizard-shell {
    --hw-bg:        #ffffff;
    --hw-surface:   #f7f8fa;
    --hw-surface-2: #eef1f5;
    --hw-border:    #e3e6ec;
    --hw-border-strong: #c8cdd6;
    --hw-text:      #1c1f24;
    --hw-text-soft: #5a6372;
    --hw-text-mute: #8a93a3;
    --hw-primary:   var(--hoc-accent, #0078d4);
    --hw-primary-fg:#ffffff;
    --hw-success:   #1f7a3a;
    --hw-error:     #b22424;
    --hw-warn:      #b87900;
    --hw-info:      #1e6fb8;
    --hw-radius:    10px;
    --hw-radius-sm: 6px;
}

/* ── Modal host sizing ─────────────────────────────────────────── */
.hoc-modal-dialog.hoc-modal-lg,
.hoc-wizard-modal-host {
    width: 780px;
    max-width: calc(100vw - 32px);
}
.hoc-modal-body.hoc-wizard-modal-host {
    padding: 0 !important;
}
.hoc-modal-body.hoc-wizard-modal-host .hoc-wizard-shell {
    padding: 24px 28px 18px;
}

/* Reset uppercase from admin.css inside the wizard */
.hoc-wizard-shell label,
.hoc-wizard-shell .hoc-form-label,
.hoc-wizard-shell legend {
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 13px;
    font-weight: 500;
    color: var(--hw-text-soft);
}

/* ── Shell layout ──────────────────────────────────────────────── */
.hoc-wizard-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: var(--hw-text);
    font-size: 14px;
    line-height: 1.55;
    position: relative;
}


/* Inline / Page modes */
.hoc-wizard-inline .hoc-wizard-shell,
.hoc-wizard-page  .hoc-wizard-shell {
    background: var(--hw-bg);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-radius);
    padding: 24px 28px;
}
.hoc-wizard-page-header { margin: 0 0 16px; }
.hoc-wizard-page-title { font-size: 22px; font-weight: 600; margin: 0; }

/* ── Drawer ────────────────────────────────────────────────────── */
.hoc-wizard-drawer { position: fixed; inset: 0; z-index: 10000; pointer-events: none; }
.hoc-wizard-drawer-backdrop {
    position: absolute; inset: 0; background: rgba(0,0,0,0.35);
    opacity: 0; transition: opacity .2s; pointer-events: auto;
}
.hoc-wizard-drawer-panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(640px, 100vw);
    background: var(--hw-bg); box-shadow: -8px 0 24px rgba(0,0,0,0.18);
    transform: translateX(100%); transition: transform .25s ease-out;
    display: flex; flex-direction: column; pointer-events: auto;
}
.hoc-wizard-drawer.hoc-wizard-drawer-open .hoc-wizard-drawer-backdrop { opacity: 1; }
.hoc-wizard-drawer.hoc-wizard-drawer-open .hoc-wizard-drawer-panel { transform: translateX(0); }
.hoc-wizard-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--hw-border);
}
.hoc-wizard-drawer-title { font-size: 17px; font-weight: 600; }
.hoc-wizard-drawer-close {
    background: transparent; border: 0; font-size: 18px; color: var(--hw-text-soft);
    cursor: pointer; padding: 6px 8px; border-radius: 4px;
}
.hoc-wizard-drawer-close:hover { background: var(--hw-surface); }
.hoc-wizard-drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* ── Stepper (NEW: compact progress + meta, no giant circles) ─── */
.hoc-wizard-stepper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    margin: 0 0 4px;
}
.hoc-wizard-step-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hw-text-mute);
}
.hoc-wizard-step-meta-current {
    color: var(--hw-primary);
}
.hoc-wizard-step-meta-phases {
    display: flex;
    gap: 4px;
}
.hoc-wizard-step-meta-phases .hw-phase {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--hw-surface-2);
    transition: background .2s, transform .2s;
}
.hoc-wizard-step-meta-phases .hw-phase-done {
    background: var(--hw-primary);
    opacity: 0.6;
}
.hoc-wizard-step-meta-phases .hw-phase-active {
    background: var(--hw-primary);
    transform: scale(1.4);
}
.hoc-wizard-progress-rail {
    width: 100%;
    height: 4px;
    background: var(--hw-surface-2);
    border-radius: 999px;
    overflow: hidden;
}
.hoc-wizard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hw-primary), color-mix(in srgb, var(--hw-primary) 70%, white));
    border-radius: 999px;
    transition: width .35s ease;
}

/* ── Step title + subtitle inside body ─────────────────────────── */
.hoc-wizard-step-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 8px 0 4px;
}
.hoc-wizard-step-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--hw-text);
    margin: 0;
    letter-spacing: -0.01em;
}
.hoc-wizard-step-subtitle {
    font-size: 14px;
    color: var(--hw-text-soft);
    margin: 0;
}

/* ── Body ──────────────────────────────────────────────────────── */
.hoc-wizard-body {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.hoc-wizard-body-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}
.hoc-wizard-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--hw-border);
    border-top-color: var(--hw-primary);
    border-radius: 50%;
    animation: hoc-wizard-spin 0.8s linear infinite;
}
@keyframes hoc-wizard-spin { to { transform: rotate(360deg); } }

/* Form grid spacing inside steps */
.hoc-wizard-form-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.hoc-wizard-form-grid .hoc-form-group { margin: 0; }
.hoc-wizard-shell .hoc-input,
.hoc-wizard-shell .hoc-input[type] {
    padding: 10px 12px;
    font-size: 14px;
    border-radius: var(--hw-radius-sm);
    border: 1px solid var(--hw-border);
    transition: border-color .15s, box-shadow .15s;
}
.hoc-wizard-shell .hoc-input:focus {
    outline: none;
    border-color: var(--hw-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hw-primary) 18%, transparent);
}

/* Input with leading icon */
.hoc-wizard-input-icon {
    position: relative;
}
.hoc-wizard-input-icon > i {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--hw-text-mute);
    font-size: 14px;
    pointer-events: none;
}
.hoc-wizard-input-icon > input,
.hoc-wizard-input-icon > .hoc-pw-wrap > input {
    padding-left: 36px !important;
}

/* ── Errors / Warnings ─────────────────────────────────────────── */
.hoc-wizard-error { display: flex; flex-direction: column; gap: 6px; }
.hoc-wizard-error-row {
    background: color-mix(in srgb, var(--hw-error) 8%, transparent);
    color: var(--hw-error);
    border: 1px solid color-mix(in srgb, var(--hw-error) 25%, transparent);
    padding: 10px 12px;
    border-radius: var(--hw-radius-sm);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.hoc-wizard-error-global { font-weight: 600; }
.hoc-wizard-warn-row {
    background: color-mix(in srgb, var(--hw-warn) 8%, transparent);
    color: var(--hw-warn);
    border: 1px solid color-mix(in srgb, var(--hw-warn) 25%, transparent);
    padding: 10px 12px;
    border-radius: var(--hw-radius-sm);
    font-size: 13px;
}
.hoc-wizard-field-error {
    border-color: var(--hw-error) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hw-error) 20%, transparent) !important;
}

/* ── Info / Hint banner ────────────────────────────────────────── */
.hoc-wizard-hint {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    background: color-mix(in srgb, var(--hw-info) 7%, transparent);
    border: 1px solid color-mix(in srgb, var(--hw-info) 22%, transparent);
    border-radius: var(--hw-radius-sm);
    font-size: 13px;
    color: var(--hw-text-soft);
    line-height: 1.55;
}
.hoc-wizard-hint > i:first-child {
    color: var(--hw-info);
    font-size: 16px;
    margin-top: 1px;
    flex: 0 0 auto;
}
.hoc-wizard-hint strong { color: var(--hw-text); }
.hoc-wizard-hint a { color: var(--hw-primary); }

/* Detection chip — shown when live discover finds a provider */
.hoc-wizard-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: color-mix(in srgb, var(--hw-success) 12%, transparent);
    color: var(--hw-success);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    line-height: 1;
}
.hoc-wizard-chip i { font-size: 11px; }

/* ── Choice cards (touch-friendly tiles) ───────────────────────── */
.hoc-wizard-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.hoc-wizard-choice {
    display: flex;
    border: 2px solid var(--hw-border);
    border-radius: var(--hw-radius);
    padding: 14px;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s;
    background: var(--hw-bg);
    position: relative;
}
.hoc-wizard-choice:hover { border-color: var(--hw-border-strong); }
.hoc-wizard-choice:active { transform: scale(0.99); }

/* Active state — driven purely by the radio's :checked attribute so the
   visual follows the input automatically without any JS. Note: we do NOT
   combine with the legacy .hoc-wizard-choice-active class, otherwise a
   previously-selected tile would stay highlighted (class persists even
   after the radio moved). */
.hoc-wizard-choice:has(input[type="radio"]:checked) {
    border-color: var(--hw-primary);
    background: color-mix(in srgb, var(--hw-primary) 7%, transparent);
}
.hoc-wizard-choice:has(input[type="radio"]:checked)::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 12px; right: 12px;
    color: var(--hw-primary);
    font-size: 14px;
}
.hoc-wizard-choice-disabled { opacity: 0.5; cursor: not-allowed; }
.hoc-wizard-choice input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.hoc-wizard-choice-body { display: flex; gap: 14px; flex: 1; align-items: flex-start; }
.hoc-wizard-choice-icon {
    width: 44px; height: 44px;
    background: var(--hw-surface);
    color: var(--hw-primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex: 0 0 auto;
}
.hoc-wizard-choice:has(input[type="radio"]:checked) .hoc-wizard-choice-icon {
    background: var(--hw-primary);
    color: var(--hw-primary-fg);
}
.hoc-wizard-choice-text { display: flex; flex-direction: column; gap: 4px; padding-right: 28px; }
.hoc-wizard-choice-label { font-weight: 600; font-size: 14px; color: var(--hw-text); }
.hoc-wizard-choice-desc { font-size: 12.5px; color: var(--hw-text-soft); line-height: 1.5; }
.hoc-wizard-choice-rec { color: var(--hw-warn); font-size: 13px; }

/* ── Loading body ──────────────────────────────────────────────── */
.hoc-wizard-loading-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 48px 20px;
    text-align: center;
}
.hoc-wizard-loading-body .hoc-wizard-spinner { width: 52px; height: 52px; }
.hoc-wizard-loading-label { font-size: 16px; font-weight: 500; }
.hoc-wizard-loading-detail { font-size: 13px; color: var(--hw-text-soft); min-height: 20px; }
.hoc-wizard-progress {
    width: 100%; max-width: 320px;
    height: 6px;
    background: var(--hw-surface-2);
    border-radius: 999px;
    overflow: hidden;
}
.hoc-wizard-progress-bar {
    height: 100%;
    background: var(--hw-primary);
    transition: width .25s;
}

/* ── Result body ──────────────────────────────────────────────── */
.hoc-wizard-result {
    display: flex; flex-direction: column; align-items: center;
    gap: 14px;
    padding: 36px 20px;
    text-align: center;
}
.hoc-wizard-result-icon { font-size: 56px; }
.hoc-wizard-result-ok .hoc-wizard-result-icon { color: var(--hw-success); }
.hoc-wizard-result-error .hoc-wizard-result-icon { color: var(--hw-error); }
.hoc-wizard-result-message { font-size: 18px; font-weight: 600; }
.hoc-wizard-result-detail { font-size: 13px; color: var(--hw-text-soft); max-width: 480px; }

/* ── Review body ──────────────────────────────────────────────── */
.hoc-wizard-review {
    display: flex; flex-direction: column;
    gap: 1px;
    background: var(--hw-border);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-radius);
    overflow: hidden;
}
.hoc-wizard-review-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    padding: 12px 16px;
    background: var(--hw-bg);
}
.hoc-wizard-review-label { color: var(--hw-text-soft); font-weight: 500; }
.hoc-wizard-review-value { word-break: break-word; }

/* ── Info body ─────────────────────────────────────────────────── */
.hoc-wizard-info-body { line-height: 1.65; font-size: 14px; }
.hoc-wizard-info-body p { margin: 0 0 12px; }
.hoc-wizard-info-body ul { margin: 0; padding-left: 20px; line-height: 1.85; }
.hoc-wizard-info-body li { color: var(--hw-text); }
.hoc-wizard-info-body strong { color: var(--hw-text); font-weight: 600; }

/* ── Empty / fallback ──────────────────────────────────────────── */
.hoc-wizard-empty,
.hoc-wizard-error-body {
    padding: 40px;
    text-align: center;
    color: var(--hw-text-soft);
    font-size: 13px;
}
.hoc-wizard-error-body { color: var(--hw-error); }

/* ── Footer / Buttons ──────────────────────────────────────────── */
.hoc-wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--hw-border);
    padding-top: 16px;
    margin-top: 4px;
}
.hoc-wizard-footer-left, .hoc-wizard-footer-right {
    display: flex; gap: 8px;
}
.hoc-wizard-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--hw-radius-sm);
    border: 1px solid transparent;
    background: var(--hw-surface);
    color: var(--hw-text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    min-height: 38px;
    transition: background .12s, border-color .12s, opacity .12s, transform .08s;
}
.hoc-wizard-btn:hover { background: var(--hw-border); }
.hoc-wizard-btn:active { transform: scale(0.98); }
.hoc-wizard-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.hoc-wizard-btn:focus-visible {
    outline: 2px solid var(--hw-primary);
    outline-offset: 2px;
}

.hoc-wizard-btn-primary {
    background: var(--hw-primary);
    color: var(--hw-primary-fg);
    border-color: var(--hw-primary);
}
.hoc-wizard-btn-primary:hover {
    background: color-mix(in srgb, var(--hw-primary) 88%, black);
}
.hoc-wizard-btn-secondary {
    background: transparent;
    border: 1px solid var(--hw-border-strong);
}
.hoc-wizard-btn-secondary:hover {
    background: var(--hw-surface);
}
.hoc-wizard-btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--hw-text-soft);
}
.hoc-wizard-btn-ghost:hover { background: var(--hw-surface); color: var(--hw-text); }

/* Inline spinner for buttons in a busy state (e.g. Next during validation) */
.hoc-wizard-btn-spinner {
    display: inline-block;
    width: 13px; height: 13px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: hoc-wizard-spin 0.7s linear infinite;
    vertical-align: -2px;
}

/* Touch-first: 44px hit targets */
.hoc-wizard-shell[data-touch="1"] .hoc-wizard-btn {
    min-height: 44px;
    padding: 11px 20px;
    font-size: 15px;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .hoc-modal-body.hoc-wizard-modal-host .hoc-wizard-shell {
        padding: 18px 18px 14px;
    }
    .hoc-wizard-step-title { font-size: 18px; }
    .hoc-wizard-footer { flex-direction: column-reverse; align-items: stretch; }
    .hoc-wizard-footer-left, .hoc-wizard-footer-right { width: 100%; }
    .hoc-wizard-btn { flex: 1; justify-content: center; }
    .hoc-wizard-review-row { grid-template-columns: 1fr; gap: 2px; }
}
