/* QuantumYield Installer — scoped styles */
:root[data-theme="dark"] {
    --qy-bg-0: #0b0e14;
    --qy-bg-1: #11151c;
    --qy-bg-2: #161b24;
    --qy-border: #1f2733;
    --qy-border-strong: #2a3342;
    --qy-text: #e6e9ef;
    --qy-text-muted: #9aa4b2;
    --qy-text-dim: #6b7280;
    --qy-primary: #f0b429;
    --qy-primary-hover: #ffc94a;
    --qy-secondary: #00d4b4;
    --qy-danger: #ff5e6c;
    --qy-success: #34d399;
    --qy-warn: #fbbf24;
    --qy-info: #60a5fa;
    --qy-shadow-md: 0 8px 24px rgba(0,0,0,.35);
    --qy-shadow-lg: 0 24px 64px rgba(0,0,0,.55);
    --qy-radius: 10px;
    --qy-radius-lg: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    font-family: 'DM Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background:
        radial-gradient(1200px 600px at 0% 0%, rgba(240,180,41,.06), transparent 60%),
        radial-gradient(1000px 500px at 100% 100%, rgba(0,212,180,.05), transparent 60%),
        var(--qy-bg-0);
    color: var(--qy-text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--qy-primary); text-decoration: none; }
a:hover { color: var(--qy-primary-hover); }
code { background: var(--qy-bg-0); color: var(--qy-primary); padding: 2px 6px; border-radius: 4px; font-size: .9em; }

.qy-install {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 100vh;
}

.qy-install__rail {
    background: linear-gradient(180deg, var(--qy-bg-1), var(--qy-bg-2));
    border-right: 1px solid var(--qy-border);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
}

.qy-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.qy-brand__mark {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--qy-primary), #c8930f);
    color: #1a1300;
    font-weight: 800;
    border-radius: 10px;
    display: grid; place-items: center;
    box-shadow: 0 6px 16px rgba(240,180,41,.3);
    font-family: 'Syne', sans-serif;
}
.qy-brand__name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 18px; }
.qy-brand__sub { font-size: 12px; color: var(--qy-text-muted); }

.qy-steps { list-style: none; padding: 0; margin: 0; flex: 1; }
.qy-steps__item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--qy-text-muted);
    transition: background .2s;
}
.qy-steps__item--current {
    background: rgba(240,180,41,.08);
    color: var(--qy-text);
    font-weight: 600;
}
.qy-steps__item--done { color: var(--qy-success); }
.qy-steps__dot {
    width: 26px; height: 26px;
    display: grid; place-items: center;
    border-radius: 50%;
    border: 1px solid var(--qy-border-strong);
    font-size: 12px;
    font-weight: 700;
    background: var(--qy-bg-0);
    flex-shrink: 0;
}
.qy-steps__item--current .qy-steps__dot {
    border-color: var(--qy-primary);
    color: var(--qy-primary);
    box-shadow: 0 0 0 4px rgba(240,180,41,.12);
}
.qy-steps__item--done .qy-steps__dot {
    border-color: var(--qy-success);
    color: var(--qy-success);
}

.qy-rail__foot { color: var(--qy-text-dim); font-size: 11px; }

.qy-install__main {
    padding: 48px 56px;
    max-width: 920px;
    width: 100%;
    margin: 0 auto;
}

.qy-progress {
    height: 4px;
    background: var(--qy-bg-2);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 32px;
}
.qy-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--qy-primary), var(--qy-secondary));
    transition: width .4s ease;
}

.qy-card {
    background: var(--qy-bg-1);
    border: 1px solid var(--qy-border);
    border-radius: var(--qy-radius-lg);
    box-shadow: var(--qy-shadow-md);
    overflow: hidden;
}
.qy-card__head {
    padding: 28px 32px 16px;
    border-bottom: 1px solid var(--qy-border);
}
.qy-card__head h1 {
    margin: 0 0 6px;
    font-family: 'Syne', sans-serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.01em;
}
.qy-card__body { padding: 28px 32px 32px; }

.qy-muted { color: var(--qy-text-muted); margin: 0; }
.qy-mt { margin-top: 16px; }

.qy-section {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--qy-text-dim);
    margin: 28px 0 12px;
    font-weight: 700;
}

.qy-feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: grid;
    gap: 8px;
}
.qy-feature-list li {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: var(--qy-bg-2);
    border: 1px solid var(--qy-border);
    border-radius: 8px;
    font-size: 14px;
}
.qy-feature-list__icon { font-size: 16px; }

.qy-form { display: flex; flex-direction: column; gap: 16px; }
.qy-form--inline { gap: 12px; }
.qy-form__actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.qy-grid { display: grid; gap: 16px; }
.qy-grid--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .qy-grid--2 { grid-template-columns: 1fr; } }

.qy-field { display: flex; flex-direction: column; gap: 6px; }
.qy-field--full { grid-column: 1 / -1; }
.qy-field__label { font-size: 13px; font-weight: 600; color: var(--qy-text); }
.qy-field__hint { font-size: 12px; color: var(--qy-text-dim); }

.qy-field input, .qy-field select {
    background: var(--qy-bg-0);
    border: 1px solid var(--qy-border-strong);
    color: var(--qy-text);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.qy-field input:focus, .qy-field select:focus {
    outline: none;
    border-color: var(--qy-primary);
    box-shadow: 0 0 0 3px rgba(240,180,41,.18);
}

.qy-check {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 14px 16px;
    background: var(--qy-bg-2);
    border: 1px solid var(--qy-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}
.qy-check input { margin-top: 3px; }

.qy-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    min-height: 40px;
}
.qy-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(240,180,41,.4);
}
.qy-btn--primary {
    background: linear-gradient(180deg, var(--qy-primary), #d99a16);
    color: #1a1300;
    box-shadow: 0 4px 12px rgba(240,180,41,.25);
}
.qy-btn--primary:hover { filter: brightness(1.06); }
.qy-btn--primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.qy-btn--secondary {
    background: var(--qy-bg-2);
    border-color: var(--qy-border-strong);
    color: var(--qy-text);
}
.qy-btn--secondary:hover { border-color: var(--qy-primary); color: var(--qy-primary); }
.qy-btn--ghost {
    background: transparent; color: var(--qy-text-muted);
}
.qy-btn--ghost:hover { color: var(--qy-text); }
.qy-btn--lg { padding: 14px 28px; font-size: 15px; min-height: 48px; }

.qy-alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid;
    font-size: 14px;
}
.qy-alert--error { background: rgba(255,94,108,.08); border-color: rgba(255,94,108,.4); color: #ffb3bb; }
.qy-alert--ok    { background: rgba(52,211,153,.08); border-color: rgba(52,211,153,.4); color: #6ee7b7; }
.qy-alert ul { margin: 6px 0 0; padding-left: 20px; }

.qy-checklist {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}
.qy-checklist th, .qy-checklist td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--qy-border);
}
.qy-checklist th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--qy-text-dim);
    font-weight: 700;
    background: var(--qy-bg-2);
}

.qy-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
}
.qy-pill--ok   { background: rgba(52,211,153,.15);  color: var(--qy-success); }
.qy-pill--bad  { background: rgba(255,94,108,.15);  color: var(--qy-danger); }
.qy-pill--warn { background: rgba(251,191,36,.15);  color: var(--qy-warn); }

.qy-result {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid;
}
.qy-result--ok  { background: rgba(52,211,153,.08); border-color: rgba(52,211,153,.35); color: #6ee7b7; }
.qy-result--bad { background: rgba(255,94,108,.08); border-color: rgba(255,94,108,.35); color: #ffb3bb; }

.qy-log {
    background: var(--qy-bg-0);
    border: 1px solid var(--qy-border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-size: 13px;
    max-height: 300px;
    overflow: auto;
}
.qy-log__line { color: var(--qy-success); padding: 1px 0; }

.qy-summary {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 20px;
    margin: 0 0 24px;
    padding: 18px 20px;
    background: var(--qy-bg-2);
    border: 1px solid var(--qy-border);
    border-radius: 8px;
    font-size: 14px;
}
.qy-summary dt { color: var(--qy-text-muted); font-weight: 500; }
.qy-summary dd { margin: 0; color: var(--qy-text); font-weight: 500; }

.qy-details {
    background: var(--qy-bg-2);
    border: 1px solid var(--qy-border);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0;
}
.qy-details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--qy-text-muted);
    padding: 4px 0;
    user-select: none;
}
.qy-details[open] summary { color: var(--qy-text); margin-bottom: 14px; }

.qy-strength {
    height: 6px;
    background: var(--qy-bg-2);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 4px;
}
.qy-strength__bar {
    height: 100%;
    width: 0;
    background: var(--qy-danger);
    transition: width .25s, background .25s;
}

.qy-finish {
    list-style: none;
    counter-reset: step;
    padding: 0; margin: 0 0 24px;
}
.qy-finish li {
    counter-increment: step;
    padding: 14px 16px 14px 56px;
    background: var(--qy-bg-2);
    border: 1px solid var(--qy-border);
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    font-size: 14px;
    line-height: 1.6;
}
.qy-finish li::before {
    content: counter(step);
    position: absolute;
    left: 16px; top: 14px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--qy-primary);
    color: #1a1300;
    display: grid; place-items: center;
    font-weight: 700;
    font-size: 13px;
}
.qy-cta { text-align: center; margin: 24px 0; }

.qy-card--celebrate { border-color: rgba(240,180,41,.3); box-shadow: 0 0 0 1px rgba(240,180,41,.15), var(--qy-shadow-md); }

@media (max-width: 880px) {
    .qy-install { grid-template-columns: 1fr; }
    .qy-install__rail { padding: 20px; }
    .qy-install__main { padding: 24px; }
    .qy-card__head, .qy-card__body { padding-left: 20px; padding-right: 20px; }
    .qy-summary { grid-template-columns: 1fr; }
}

/* ============================================================
   Success page (step 7)
============================================================ */
.qy-success { display: flex; flex-direction: column; gap: 24px; }

.qy-success__hero {
    text-align: center;
    padding: 32px 24px 8px;
}
.qy-success__hero h1 {
    font-family: 'Syne', sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin: 16px 0 8px;
    background: linear-gradient(135deg, #34d399 0%, var(--qy-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.qy-success__hero p { max-width: 520px; margin: 0 auto; }

.qy-success__check {
    display: inline-grid;
    place-items: center;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(52,211,153,.1);
    border: 2px solid rgba(52,211,153,.4);
    box-shadow: 0 0 0 8px rgba(52,211,153,.06), 0 12px 32px rgba(52,211,153,.18);
    animation: qySuccessPop .5s cubic-bezier(.22,1,.36,1) both;
}
@keyframes qySuccessPop {
    from { transform: scale(.6); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}
.qy-success__check-bg {
    stroke: rgba(52,211,153,.3); stroke-width: 2;
    stroke-dasharray: 152; stroke-dashoffset: 152;
    animation: qySuccessRing .5s ease-out forwards .15s;
}
.qy-success__check-tick {
    stroke: #34d399; stroke-width: 4;
    stroke-dasharray: 48; stroke-dashoffset: 48;
    animation: qySuccessTick .35s ease-out forwards .45s;
}
@keyframes qySuccessRing { to { stroke-dashoffset: 0; } }
@keyframes qySuccessTick { to { stroke-dashoffset: 0; } }

/* ── Credentials card ───────────────────────────────────── */
.qy-creds {
    background: linear-gradient(180deg, var(--qy-bg-1) 0%, var(--qy-bg-2) 100%);
    border: 1px solid var(--qy-border);
    border-radius: var(--qy-radius-lg);
    padding: 28px 32px;
    box-shadow: var(--qy-shadow-md);
}
.qy-creds__head {
    display: flex; align-items: center; gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--qy-border);
    margin-bottom: 18px;
}
.qy-creds__site {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--qy-text);
}
.qy-creds__sub {
    font-size: 12px;
    color: var(--qy-text-dim);
    margin-top: 2px;
}

.qy-brand-mark {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--qy-primary), #c8930f);
    color: #1a1300;
    font-weight: 800;
    font-family: 'Syne', sans-serif;
    border-radius: 10px;
    display: grid; place-items: center;
    box-shadow: 0 6px 16px rgba(240,180,41,.3);
}

.qy-creds__list {
    display: flex; flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 0;
}
.qy-creds__row {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    transition: background .15s;
}
.qy-creds__row:hover { background: rgba(255,255,255,.02); }
.qy-creds__row dt {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--qy-text-muted);
}
.qy-creds__row dd {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.qy-creds__value {
    background: var(--qy-bg-0);
    border: 1px solid var(--qy-border);
    color: var(--qy-text);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    font-size: 13px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.qy-creds__value--secret {
    color: var(--qy-primary);
    font-weight: 600;
    letter-spacing: 2px;
}

.qy-iconbtn {
    flex-shrink: 0;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    background: var(--qy-bg-2);
    border: 1px solid var(--qy-border-strong);
    color: var(--qy-text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s;
}
.qy-iconbtn:hover {
    color: var(--qy-primary);
    border-color: var(--qy-primary);
    background: rgba(240,180,41,.06);
}
.qy-iconbtn.is-copied {
    color: #34d399;
    border-color: #34d399;
    background: rgba(52,211,153,.08);
}
.qy-iconbtn__icon { font-size: 14px; }

.qy-creds__warn {
    margin-top: 18px;
    padding: 12px 14px;
    background: rgba(240,180,41,.06);
    border: 1px solid rgba(240,180,41,.25);
    border-radius: 8px;
    font-size: 13px;
    color: var(--qy-primary);
}
.qy-creds__warn strong { color: var(--qy-text); }

/* ── Action grid ─────────────────────────────────────────── */
.qy-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (max-width: 720px) { .qy-actions { grid-template-columns: 1fr; } }

.qy-action {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px;
    background: var(--qy-bg-1);
    border: 1px solid var(--qy-border);
    border-radius: var(--qy-radius);
    color: var(--qy-text);
    text-decoration: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: all .2s var(--qy-ease, ease-out);
}
.qy-action:hover {
    border-color: var(--qy-primary);
    background: rgba(240,180,41,.04);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,.2);
}
.qy-action__icon {
    width: 40px; height: 40px;
    border-radius: 8px;
    background: var(--qy-bg-2);
    display: grid; place-items: center;
    font-size: 18px;
    color: var(--qy-primary);
    flex-shrink: 0;
}
.qy-action__label { font-size: 14px; font-weight: 600; }
.qy-action__hint  { font-size: 12px; color: var(--qy-text-dim); margin-top: 2px; }

/* ── Final security box ──────────────────────────────────── */
.qy-finalbox {
    background: var(--qy-bg-1);
    border: 1px solid rgba(255,94,108,.3);
    border-radius: var(--qy-radius-lg);
    overflow: hidden;
}
.qy-finalbox__head {
    padding: 20px 24px 8px;
    border-bottom: 1px solid var(--qy-border);
}
.qy-finalbox__head h2 {
    margin: 0 0 4px;
    font-size: 18px;
    font-family: 'Syne', sans-serif;
    color: var(--qy-text);
}
.qy-finalbox__body { padding: 18px 24px 22px; }

.qy-btn--lg .qy-btn__icon { margin-right: 6px; }
.qy-mt--sm { margin-top: 8px; font-size: 12px; }

.qy-success__exit {
    text-align: center;
    padding: 8px 0 24px;
    border-top: 1px solid var(--qy-border);
    margin-top: 8px;
}

/* ── Toast (used for copy / delete feedback) ─────────────── */
.qy-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 16px);
    background: var(--qy-bg-1);
    color: var(--qy-text);
    border: 1px solid var(--qy-border-strong);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 13px;
    box-shadow: var(--qy-shadow-lg);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity .25s, transform .25s;
}
.qy-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
.qy-toast--ok   { border-color: rgba(52,211,153,.5);  color: #6ee7b7; }
.qy-toast--err  { border-color: rgba(255,94,108,.5);  color: #ffb3bb; }
