/* =========================================================
   Ovion Technologies - Installer UI (Full CSS)
   Accent: Ovion Blue (#0F5DA8)
   ========================================================= */

/* =========================
   Theme Tokens
   ========================= */
:root {
    /* brand */
    --accent: #0f5da8; /* Ovion Blue */
    --accent-2: #06b6d4; /* optional secondary */
    --accent-hover: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.14);
    --accent-soft2: rgba(37, 99, 235, 0.08);
    --accent-ring: rgba(37, 99, 235, 0.22);

    /* neutrals */
    --ink: #111827;
    --bg: #f8fafc;
    --card: #ffffff;
    --b: rgba(17, 24, 39, 0.1);
    --b2: rgba(17, 24, 39, 0.14);
    --muted: rgba(17, 24, 39, 0.6);
    --soft: rgba(17, 24, 39, 0.04);
    --soft2: rgba(17, 24, 39, 0.06);

    /* statuses */
    --okbg: rgba(16, 185, 129, 0.12);
    --oktx: #065f46;
    --badbg: rgba(239, 68, 68, 0.12);
    --badtx: #7f1d1d;

    /* radii */
    --r12: 12px;
    --r14: 14px;
    --r16: 16px;
    --r18: 18px;
}

/* =========================
   Page Shell
   ========================= */
.ins-page {
    position: relative;
    min-height: 100vh;
    isolation: isolate;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 54%, #eef4fb 100%);
}

.ins-card {
    position: relative;
    z-index: 2;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.95),
        rgba(255, 255, 255, 0.99)
    );
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--r18);
    box-shadow:
        0 30px 70px rgba(37, 99, 235, 0.12),
        0 12px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.ins-card > * {
    position: relative;
    z-index: 1;
}

.ins-body {
    overflow: visible;
}

.ins-select2-menu {
    z-index: 99999;
}

/* dropdown usually lives in body area */
/* =========================
   Top Header
   ========================= */
.ins-top {
    padding: 16px 18px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.ins-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ins-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--b);
    background: var(--soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ins-logo img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.ins-appname {
    font-weight: 900;
    color: var(--ink);
    line-height: 1.1;
}

.ins-sub {
    font-size: 0.82rem;
    color: var(--muted);
}

.ins-step-pill {
    border: 1px solid var(--b);
    background: linear-gradient(
        180deg,
        rgba(37, 99, 235, 0.08),
        rgba(37, 99, 235, 0.04)
    );
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 900;
    color: var(--ink);
    white-space: nowrap;
}

/* =========================
   Steps (supports <a> and <div>)
   ========================= */
.ins-steps {
    padding: 0 18px 14px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.ins-step {
    border: 1px solid var(--b);
    border-radius: 12px;
    padding: 10px 10px;
    font-weight: 900;
    font-size: 0.75rem;
    color: rgba(17, 24, 39, 0.78);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

.ins-step span {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: var(--soft);
    border: 1px solid var(--b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    font-weight: 900;
    font-size: 0.75rem;
}

/* active step uses brand accent */
.ins-step.active {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
    color: var(--ink);
}
.ins-step.active span {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* clickable (only when you render <a class="ins-step done">) */
.ins-steps a.ins-step {
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 0.05s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}
.ins-steps a.ins-step:hover {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 12px 26px rgba(17, 24, 39, 0.08);
    transform: translateY(-1px);
}
.ins-step.done span {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.18);
    color: var(--accent);
}

.ins-steps:hover {
    cursor: pointer;
}
/* disabled future steps (when using aria-disabled="true") */
.ins-step[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    user-select: none;
}

@media (max-width: 992px) {
    .ins-steps {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========================
   Steps Progress Bar
   ========================= */
.ins-stepsbar {
    padding: 0 18px 16px;
}

.ins-stepsbar-track {
    height: 10px;
    border-radius: 999px;
    border: 1px solid var(--b);
    background: rgba(17, 24, 39, 0.04);
    overflow: hidden;
}

.ins-stepsbar-fill {
    height: 100%;
    width: var(--p, 0%);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 22px var(--accent-soft);
    transition: width 350ms ease;
}
/* =========================
   Body + Headline
   ========================= */
.ins-body {
    padding: 16px 18px 18px;
    border-top: 1px solid rgba(17, 24, 39, 0.06);
}

.ins-headline-header {
    margin-bottom: 14px;
}

.ins-headline-header .mphb__title,
.ins-panel-header .mphb__title {
    color: var(--ink);
}

.ins-headline-header .mphb__subtitle,
.ins-panel-header .mphb__subtitle {
    color: var(--muted);
}

.ins-headline-header .mphb__badge,
.ins-panel-header .mphb__badge {
    background: var(--accent-soft2);
    border-color: var(--accent-soft);
    color: var(--accent);
}

.ins-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================
   Buttons
   ========================= */
.ins-btn {
    border-radius: 14px !important;
    padding: 0.58rem 0.95rem !important;
    font-weight: 900;
}

.ins-btn-primary {
    background: var(--accent) !important;
    border: 1px solid var(--accent) !important;
    color: #fff !important;
    box-shadow: 0 10px 24px var(--accent-soft);
}
.ins-btn-primary:hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}

/* =========================
   Alerts
   ========================= */
.ins-alert {
    margin-top: 14px;
    border-radius: 14px;
    border: 1px solid var(--b);
    padding: 12px 14px;
    font-weight: 800;
}

.ins-alert.ok {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    color: var(--oktx);
}

.ins-alert.bad {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--badtx);
}

.ins-alert.warn {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.28);
    color: #92400e;
}

/* small helper alert */
.ins-alert-mini {
    border: 1px solid rgba(17, 24, 39, 0.1);
    background: rgba(17, 24, 39, 0.02);
    border-radius: 14px;
    padding: 12px 14px;
}

/* =========================
   Summary Cards
   ========================= */
.ins-summary {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 768px) {
    .ins-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ins-card-mini {
    border: 1px solid var(--b);
    border-radius: 14px;
    background: #fff;
    padding: 12px 12px;
}

.ins-mini-label {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(17, 24, 39, 0.55);
    font-weight: 900;
}

.ins-mini-value {
    margin-top: 4px;
    font-weight: 900;
    color: var(--ink);
}

.ins-mini-cta {
    background: rgba(17, 24, 39, 0.02);
}

/* =========================
   Links / Tip / Foot
   ========================= */
.ins-linkbtn {
    border: 0;
    background: transparent;
    padding: 0;
    margin-top: 6px;
    font-weight: 900;
    color: var(--ink);
    text-decoration: underline;
    cursor: pointer;
}

.ins-tip {
    margin-top: 14px;
    font-size: 0.86rem;
    color: var(--muted);
}

.ins-foot {
    text-align: center;
    margin-top: 14px;
    color: rgba(17, 24, 39, 0.55);
    font-size: 0.85rem;
}

/* =========================
   Grid / Boxes
   ========================= */
.ins-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ins-box.wide {
    grid-column: 1 / -1;
}

@media (max-width: 992px) {
    .ins-grid {
        grid-template-columns: 1fr;
    }
}

.ins-box {
    border: 1px solid var(--b);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.ins-box-top {
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
    background: linear-gradient(
        180deg,
        rgba(37, 99, 235, 0.05),
        rgba(37, 99, 235, 0)
    );
}

.ins-box-title {
    font-weight: 900;
    color: var(--ink);
}

.ins-box-sub {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 2px;
}

.ins-badge {
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 900;
    font-size: 0.72rem;
    border: 1px solid var(--b);
    background: var(--soft2);
    color: var(--ink);
}

.ins-badge.ok {
    background: var(--okbg);
    border-color: rgba(16, 185, 129, 0.25);
    color: var(--oktx);
}

.ins-badge.bad {
    background: var(--badbg);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--badtx);
}

.ins-badge.warn {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
    color: #92400e;
}

/* padding normalize */
.ins-box .p-3 {
    padding: 14px !important;
}

/* =========================
   Fail Chips
   ========================= */
.ins-fails {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ins-empty {
    color: var(--muted);
    font-size: 0.88rem;
}

.ins-chip {
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.06);
    color: #7f1d1d;
    border-radius: 14px;
    padding: 10px 12px;
}

.ins-chip .t {
    font-weight: 900;
}

.ins-chip .m {
    font-size: 0.82rem;
    color: rgba(127, 29, 29, 0.75);
    margin-top: 2px;
}

.ins-chip.warn {
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.08);
    color: #92400e;
}

.ins-chip.warn .m {
    color: rgba(146, 64, 14, 0.78);
}

/* =========================
   Slide Panel
   ========================= */
.ins-panel {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.ins-panel.show {
    display: block;
}

.ins-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.35);
}

.ins-panel-card {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: min(880px, 96vw);
    background: #fff;
    border-left: 1px solid var(--b);
    box-shadow: -20px 0 50px rgba(17, 24, 39, 0.15);
    display: flex;
    flex-direction: column;
}

.ins-panel-head {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ins-panel-header {
    flex: 1 1 auto;
}

.ins-panel-header .mphb__content {
    align-items: center;
}

.ins-panel-title {
    font-weight: 900;
    color: var(--ink);
}

.ins-panel-sub {
    font-size: 0.84rem;
    color: var(--muted);
    margin-top: 2px;
}

.ins-panel-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ins-panel-actions .mus-field {
    margin-bottom: 0;
}

.ins-panel-actions .mus-switch-card {
    min-height: auto;
    padding: 10px 14px;
    border-radius: 14px;
}

.ins-panel-body {
    padding: 14px 16px;
    overflow: auto;
}

.ins-panel-foot {
    padding: 12px 16px;
    border-top: 1px solid rgba(17, 24, 39, 0.06);
    display: flex;
    justify-content: flex-end;
}

.ins-report {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ins-report-col {
    border: 1px solid var(--b);
    border-radius: 16px;
    overflow: hidden;
}

.ins-report-col.wide {
    grid-column: 1 / -1;
}

.ins-report-title {
    padding: 12px 14px;
    font-weight: 900;
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
    background: rgba(17, 24, 39, 0.02);
}

.ins-list {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ins-item {
    border: 1px solid var(--b);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.ins-item .l {
    font-weight: 900;
    color: var(--ink);
}

.ins-item .s {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 2px;
}

.ins-item.ok {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
}

.ins-item.bad {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

.ins-item.warn {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.22);
}

.ins-flag {
    font-weight: 900;
    font-size: 0.78rem;
    border-radius: 999px;
    padding: 6px 10px;
    border: 1px solid var(--b);
    background: var(--soft2);
}

.ins-flag.ok {
    background: var(--okbg);
    border-color: rgba(16, 185, 129, 0.25);
    color: var(--oktx);
}

.ins-flag.bad {
    background: var(--badbg);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--badtx);
}

.ins-flag.warn {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
    color: #92400e;
}

/* Make SweetAlert always on top of the installer panel */
.swal2-container {
    z-index: 100000 !important;
}

/* =========================
   Form Skin
   ========================= */
.ins-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ins-label {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(17, 24, 39, 0.55);
}

.ins-control {
    width: 100%;
    height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--b2);
    background: #fff;
    color: var(--ink);
    font-weight: 750;
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.05s ease;
    outline: none;
}

.ins-control:focus {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 4px var(--accent-ring);
}

.ins-control::placeholder {
    color: rgba(17, 24, 39, 0.35);
    font-weight: 650;
}

/* native select arrow (if you still use .ins-select anywhere) */
.ins-select {
    appearance: none;
    padding-right: 42px;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(17, 24, 39, 0.7) 50%),
        linear-gradient(135deg, rgba(17, 24, 39, 0.7) 50%, transparent 50%),
        linear-gradient(to right, rgba(17, 24, 39, 0.1), rgba(17, 24, 39, 0.1));
    background-position:
        calc(100% - 18px) 18px,
        calc(100% - 13px) 18px,
        calc(100% - 40px) 50%;
    background-size:
        5px 5px,
        5px 5px,
        1px 22px;
    background-repeat: no-repeat;
}

/* textarea */
.ins-textarea {
    height: 90px;
    padding-top: 10px;
    resize: none;
    line-height: 1.35;
}

/* helper text */
.ins-help {
    font-size: 0.78rem;
    color: rgba(17, 24, 39, 0.55);
}

/* switch row */
.ins-switchrow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(17, 24, 39, 0.1);
    background: rgba(17, 24, 39, 0.02);
}
.ins-switchrow input {
    transform: scale(1.05);
}

.ins-required-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(17, 24, 39, 0.1);
    background: rgba(17, 24, 39, 0.02);
}

.ins-required-card__body {
    flex: 1 1 auto;
}

.ins-required-card .mus-field,
.ins-required-card .mus-switch-card {
    margin-bottom: 0;
}

.ins-required-card .mus-switch-card {
    min-height: auto;
}

.ins-pill {
    font-size: 0.72rem;
    font-weight: 900;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    background: rgba(17, 24, 39, 0.04);
    color: rgba(17, 24, 39, 0.75);
    flex: 0 0 auto;
}

@media (max-width: 520px) {
    .ins-box.wide
        .p-3
        > div[style*="grid-template-columns:1fr 1fr 1.2fr .8fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* =========================
   Custom File Upload (Step 5)
   ========================= */
.ins-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ins-file {
    display: none;
}

.ins-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--b);
    background: #fff;
    border-radius: 14px;
    padding: 10px 12px;
}

.ins-upload-btn {
    border: 1px solid var(--b);
    background: var(--soft);
    color: var(--ink);
    border-radius: 12px;
    padding: 8px 12px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}
.ins-upload-btn:hover {
    background: var(--soft2);
}

.ins-upload-name {
    flex: 1;
    min-width: 0;
    color: var(--muted);
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ins-upload-clear {
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.06);
    color: var(--badtx);
    border-radius: 12px;
    padding: 8px 12px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}

.ins-upload-preview {
    border: 1px solid var(--b);
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    justify-content: center;
}

.ins-upload-preview img {
    max-height: 90px;
    max-width: 100%;
    object-fit: contain;
}

/* =========================
   Color Input + Preview
   ========================= */
.ins-color {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ins-color-picker {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--b2);
    background: #fff;
    padding: 6px;
    cursor: pointer;
}

.ins-color-hex {
    flex: 1;
}

.ins-color-swatch {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--b2);
    background: var(--c, var(--accent));
    box-shadow: 0 6px 14px rgba(17, 24, 39, 0.08);
}

.ins-color-presets {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.ins-dot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid var(--b2);
    background: var(--c);
    cursor: pointer;
}
.ins-dot:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--accent-ring);
}

/* =========================
   Better Selector (Custom Select)
   ========================= */
.ins-select2 {
    position: relative;
}

.ins-select2-btn {
    width: 100%;
    height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--b2);
    background: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
}

.ins-select2-btn:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 4px var(--accent-ring);
}

.ins-select2-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent);
}

.ins-select2-text {
    flex: 1;
    text-align: left;
    color: var(--ink);
    font-weight: 900;
}

.ins-select2-caret {
    opacity: 0.75;
    font-weight: 900;
}

.ins-select2-menu {
    position: relative;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(17, 24, 39, 0.14);
    padding: 6px;
    display: none;
    z-index: 6000;
}

.ins-select2.open .ins-select2-menu {
    display: block;
}

.ins-select2-opt {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 10px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 900;
    color: var(--ink);
    text-align: left;
}

.ins-select2-opt:hover,
.ins-select2-opt[aria-selected="true"] {
    background: rgba(37, 99, 235, 0.08);
}

.ins-select2-opt .i {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: rgba(37, 99, 235, 0.06);
    color: var(--accent);
}

/* =========================================================
   Step 4 Add-on (Database Setup) — Matches index.css tokens
   Paste at END of assets/css/installer/index.css
   ========================================================= */

/* Progress bar (the inline wrapper stays, we skin the fill) */
#setupBar {
    background: linear-gradient(
        90deg,
        var(--accent),
        var(--accent-2)
    ) !important;
    box-shadow: 0 10px 22px var(--accent-soft);
    border-radius: 999px;
    transition: width 350ms ease;
}

/* Title line "Waiting…" / "Running migrations…" */
#setupTitle {
    color: var(--ink);
}

/* Percent text "0%" */
#setupPercentText {
    font-weight: 900;
}

/* Step checklist rows polish */
.ins-box.wide .d-flex.align-items-center.justify-content-between {
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: rgba(17, 24, 39, 0.02);
    border-radius: 14px;
    padding: 10px 12px;
}

.ins-box.wide .d-flex.align-items-center.justify-content-between .fw-bold {
    font-weight: 900 !important;
}

/* Make "Steps" label consistent */
.ins-box.wide .ins-help.mb-2 {
    font-weight: 900;
    letter-spacing: 0.02em;
}

/* Logs textarea should look like your ins-control theme */
#setupLogs.ins-control,
#setupLogs.mut-textarea {
    height: auto;
    min-height: 190px;
    background: linear-gradient(180deg, #fff, rgba(17, 24, 39, 0.01));
    border-color: var(--b2);
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
        "Courier New", monospace;
}

/* Better scrollbar (optional, safe) */
#setupLogs.ins-control::-webkit-scrollbar,
#setupLogs.mut-textarea::-webkit-scrollbar {
    width: 10px;
}
#setupLogs.ins-control::-webkit-scrollbar-thumb,
#setupLogs.mut-textarea::-webkit-scrollbar-thumb {
    background: rgba(17, 24, 39, 0.18);
    border-radius: 999px;
}
#setupLogs.ins-control::-webkit-scrollbar-track,
#setupLogs.mut-textarea::-webkit-scrollbar-track {
    background: rgba(17, 24, 39, 0.05);
    border-radius: 999px;
}

/* ==========================================
   Step Status Pills
   Your JS currently only changes text.
   We'll support “state classes” for perfect UI.
   ========================================== */
.ins-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    background: rgba(17, 24, 39, 0.04);
    color: rgba(17, 24, 39, 0.75);
}

/* Pending (default) */
.ins-pill.is-pending {
    border-color: rgba(17, 24, 39, 0.14);
    background: rgba(17, 24, 39, 0.04);
    color: rgba(17, 24, 39, 0.72);
}

/* Running */
.ins-pill.is-running {
    border-color: rgba(37, 99, 235, 0.22);
    background: rgba(37, 99, 235, 0.08);
    color: var(--ink);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.1);
}

/* Done */
.ins-pill.is-done {
    border-color: rgba(16, 185, 129, 0.25);
    background: var(--okbg);
    color: var(--oktx);
}

/* Skipped */
.ins-pill.is-skipped {
    border-color: rgba(17, 24, 39, 0.12);
    background: rgba(17, 24, 39, 0.03);
    color: rgba(17, 24, 39, 0.55);
}

/* Failed */
.ins-pill.is-failed {
    border-color: rgba(239, 68, 68, 0.25);
    background: var(--badbg);
    color: var(--badtx);
}

/* Small dot indicator (optional, looks premium) */
.ins-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.25);
}

.ins-pill.is-running::before {
    background: var(--accent);
}
.ins-pill.is-done::before {
    background: #10b981;
}
.ins-pill.is-failed::before {
    background: #ef4444;
}
.ins-pill.is-skipped::before {
    background: rgba(17, 24, 39, 0.25);
}

/* =========================================================
   Premium Tooltip (BELOW) for Installer Stepper
   Drop this at the END of assets/css/installer/index.css
   ========================================================= */

/* make sure tooltips are not clipped */
.ins-steps,
.ins-card,
.ins-body {
    overflow: visible;
}

.ins-step {
    position: relative;
    outline: none;
}

/* Tooltip bubble (below the step) */
.ins-step .ins-tip {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);

    width: 320px;
    max-width: min(320px, 74vw);

    padding: 12px 12px 12px 12px;
    border-radius: 16px;

    background: rgba(17, 24, 39, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 26px 70px rgba(0, 0, 0, 0.22),
        0 10px 22px rgba(0, 0, 0, 0.14);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
        visibility 220ms cubic-bezier(0.2, 0.8, 0.2, 1);

    z-index: 9999;
}

/* Title + description */
.ins-step .ins-tip-title {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.98);
}

.ins-step .ins-tip-desc {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.82);
}

/* Arrow on TOP of tooltip (pointing to the step) */
.ins-step .ins-tip-arrow {
    position: absolute;
    top: -6px;
    left: 50%;
    width: 12px;
    height: 12px;

    transform: translateX(-50%) rotate(45deg);

    background: rgba(17, 24, 39, 0.92);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.12);

    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.14);
}

/* Show tooltip on hover + focus */
.ins-step:hover .ins-tip,
.ins-step:focus .ins-tip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Nice keyboard focus ring */
.ins-step:focus {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
    border-radius: 14px;
}

/* Mobile: show only on focus (hover is unreliable) */
@media (max-width: 991.98px) {
    .ins-step:hover .ins-tip {
        opacity: 0;
        visibility: hidden;
    }
    .ins-step:focus .ins-tip {
        opacity: 1;
        visibility: visible;
    }
}

/* Prevent off-screen tooltips (first and last step clamp) */
.ins-step:first-child .ins-tip {
    left: 0;
    transform: translateY(-10px);
}
.ins-step:first-child:hover .ins-tip,
.ins-step:first-child:focus .ins-tip {
    transform: translateY(0);
}
.ins-step:first-child .ins-tip-arrow {
    left: 26px;
    transform: rotate(45deg);
}

.ins-step:last-child .ins-tip {
    left: auto;
    right: 0;
    transform: translateY(-10px);
}
.ins-step:last-child:hover .ins-tip,
.ins-step:last-child:focus .ins-tip {
    transform: translateY(0);
}
.ins-step:last-child .ins-tip-arrow {
    left: auto;
    right: 26px;
    transform: rotate(45deg);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ins-step .ins-tip {
        transition: none;
    }
}
/* =========================================
   Custom Select2: open as overlay (no push)
   ========================================= */

.ins-select2 {
    position: relative; /* anchor for absolute menu */
}

/* Button stays normal */
.ins-select2-btn {
    width: 100%;
}

/* Dropdown menu overlays instead of pushing layout */
.ins-select2-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);

    display: none; /* hidden by default */
    z-index: 5000;

    border-radius: 14px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    background: #fff;

    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.14);
    overflow: hidden;
}

/* When open */
.ins-select2.open .ins-select2-menu {
    display: block;
    animation: insDropIn 0.18s ease;
}

@keyframes insDropIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Options */
.ins-select2-opt {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    background: transparent;
    border: 0;
}

.ins-select2-opt:hover {
    background: rgba(17, 24, 39, 0.04);
}

/* ============================
   Password Policy Box
   ============================ */
.ins-policy {
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.72);
    padding: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.ins-policy-top {
    margin-bottom: 10px;
}

.ins-policy-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.ins-policy-list li {
    position: relative;
    padding-left: 26px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.7);
    transition:
        transform 0.18s ease,
        color 0.18s ease,
        opacity 0.18s ease;
    opacity: 0.85;
}

.ins-policy-list li::before {
    content: "○";
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    text-align: center;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.35);
    transition:
        color 0.18s ease,
        transform 0.18s ease;
}

/* PASS */
.ins-policy-list li.is-ok {
    color: rgba(0, 0, 0, 0.85);
    opacity: 1;
    transform: translateX(2px);
}
.ins-policy-list li.is-ok::before {
    content: "✓";
    color: rgba(16, 185, 129, 1);
    transform: scale(1.05);
}

/* FAIL (only when user started typing) */
.ins-policy-list.is-dirty li.is-bad {
    color: rgba(220, 38, 38, 0.85);
    opacity: 1;
}
.ins-policy-list.is-dirty li.is-bad::before {
    content: "✕";
    color: rgba(220, 38, 38, 1);
}

.ins-policy-note {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.6);
}
a.disable {
    pointer-events: none;
    opacity: 0.55;
    filter: saturate(0.7);
}

a[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
}
/* Optional (add in installer css) */
.ins-step.locked-by-installer {
    cursor: not-allowed !important;
    pointer-events: auto; /* keep hover tooltip working */
    opacity: 0.9;
}

/* =========================
   Shared UI Components
   ========================= */
.ins-page .ins-box .mui-field,
.ins-page .ins-box .mun-field,
.ins-page .ins-box .mps-field,
.ins-page .ins-box .mph-field,
.ins-page .ins-box .mds-field,
.ins-page .ins-box .mcl-field,
.ins-page .ins-box .mdu-field,
.ins-page .ins-box .mut-field,
.ins-page .ins-box .mus-field {
    margin-bottom: 0;
}

.ins-page .ins-box .mui-hint,
.ins-page .ins-box .mun-hint,
.ins-page .ins-box .mps-hint,
.ins-page .ins-box .mph-hint,
.ins-page .ins-box .mds-hint,
.ins-page .ins-box .mcl-hint,
.ins-page .ins-box .mut-hint {
    color: var(--muted);
}

.ins-page .ins-box .mus-switch-card {
    min-height: 100%;
}

.ins-page .ins-box .mdu-upload__title,
.ins-page .ins-box .mdu-upload__subtitle {
    color: var(--ink);
}

.ins-page .ins-box .mdu-upload__subtitle {
    color: var(--muted);
}

.ins-page .ins-box .select2-container {
    width: 100% !important;
}

.ins-page .ins-box-top .mphb__title,
.ins-page .ins-box-top .mphb__subtitle,
.ins-page .ins-box-top .mphb__badge {
    color: inherit;
}

.ins-page .ins-box-top .mphb__title {
    color: var(--ink);
}

.ins-page .ins-box-top .mphb__subtitle {
    color: var(--muted);
}

.ins-page .ins-box-top .mphb__content,
.ins-page .ins-box-top .mphb__right {
    align-items: center;
}

.ins-page .ins-box-top .mphb__badge {
    background: var(--accent-soft2);
    border-color: var(--accent-soft);
    color: var(--ink);
}

.ins-log-panel {
    margin-top: 1rem;
}

.ins-log-panel .mphb {
    margin-bottom: 0;
}

.ins-log-panel__body {
    margin-top: 0.75rem;
}

@media (max-width: 768px) {
    .ins-required-card {
        align-items: stretch;
        flex-direction: column;
    }

    .ins-panel-actions {
        width: 100%;
    }

    .ins-panel-actions .col-auto {
        width: 100%;
    }
}

.installer-layout .ins-card {
    backdrop-filter: none;
}

.installer-layout .app-page-loader__backdrop {
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: none;
}

.installer-layout .app-page-loader__panel {
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.installer-layout .app-page-loader__orbit,
.installer-layout .app-page-loader__eyebrow::before {
    animation: none !important;
}
