.setup-page .auth-main { padding-top: 40px; padding-bottom: 40px; }
.setup-card { max-width: 520px; }
.setup-card--wide { max-width: 640px; }

.setup-showcase { background: #070b1a; }
.setup-showcase .setup-tech-img { animation: setup-drift 40s ease-in-out infinite alternate; transform: scale(1.08); }
@keyframes setup-drift { to { transform: scale(1.08) translate3d(-2%, -3%, 0); } }
.setup-showcase .auth-showcase-overlay {
    background:
        radial-gradient(700px 420px at 20% 55%, rgba(7,11,26,.78), transparent 70%),
        linear-gradient(180deg, rgba(7,11,26,.35) 0%, rgba(7,11,26,.15) 40%, rgba(7,11,26,.85) 100%);
}
.setup-scan {
    position: absolute; inset-inline: 0; top: -30%; height: 30%; z-index: 0; pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(34,211,238,.07) 70%, rgba(34,211,238,.18));
    border-bottom: 1px solid rgba(103,232,249,.35);
    animation: setup-scan 6s linear infinite;
}
@keyframes setup-scan { to { top: 100%; } }

.setup-intro { margin-top: auto; max-width: 520px; }
.setup-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px; font-weight: 600; letter-spacing: .04em;
    color: #a5f3fc; padding: 6px 12px; border-radius: 999px;
    background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.3);
    margin-bottom: 18px;
}
.setup-pulse { width: 8px; height: 8px; border-radius: 50%; background: #22d3ee; box-shadow: 0 0 0 0 rgba(34,211,238,.6); animation: setup-pulse 1.8s ease-out infinite; }
@keyframes setup-pulse { 70% { box-shadow: 0 0 0 9px rgba(34,211,238,0); } 100% { box-shadow: 0 0 0 0 rgba(34,211,238,0); } }

.setup-terminal {
    margin-top: 26px;
    border-radius: 16px; overflow: hidden;
    background: rgba(9,13,32,.72);
    border: 1px solid rgba(129,140,248,.28);
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.05);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.setup-terminal-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-bottom: 1px solid rgba(129,140,248,.18);
    background: rgba(255,255,255,.03);
}
.setup-terminal-dots { display: inline-flex; gap: 6px; }
.setup-terminal-dots span { width: 10px; height: 10px; border-radius: 50%; background: #f87171; }
.setup-terminal-dots span:nth-child(2) { background: #fbbf24; }
.setup-terminal-dots span:nth-child(3) { background: #34d399; }
.setup-terminal-title { font-size: 12px; color: rgba(226,232,240,.55); }

.setup-terminal-body { list-style: none; margin: 0; padding: 10px 6px; }
.setup-line {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 10px; border-radius: 10px;
    color: rgba(226,232,240,.45);
    animation: setup-type .45s ease both;
}
.setup-line:nth-child(2) { animation-delay: .12s; }
.setup-line:nth-child(3) { animation-delay: .24s; }
.setup-line:nth-child(4) { animation-delay: .36s; }
@keyframes setup-type { from { opacity: 0; transform: translateX(-8px); } }
.setup-line.is-running { background: rgba(99,102,241,.16); color: #fff; box-shadow: inset 2px 0 0 #818cf8; }
[dir="rtl"] .setup-line.is-running { box-shadow: inset -2px 0 0 #818cf8; }
.setup-line.is-done { color: rgba(226,232,240,.8); }
.setup-line-status {
    width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
    border: 1px solid rgba(148,163,184,.25);
}
.setup-line.is-done .setup-line-status { background: rgba(52,211,153,.15); border-color: rgba(52,211,153,.45); color: #6ee7b7; }
.setup-line.is-running .setup-line-status { border-color: rgba(129,140,248,.6); }
.setup-line-spinner {
    width: 13px; height: 13px; border-radius: 50%;
    border: 2px solid rgba(165,180,252,.3); border-top-color: #c7d2fe;
    animation: auth-spin .8s linear infinite;
}
.setup-line-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.setup-line-name { font-size: 13px; font-weight: 600; font-family: 'Inter', -apple-system, sans-serif; }
.setup-line-desc { font-size: 11.5px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setup-line-tag {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    padding: 3px 8px; border-radius: 6px; border: 1px solid rgba(148,163,184,.25);
}
[dir="rtl"] .setup-line-tag { letter-spacing: 0; }
.setup-line.is-done .setup-line-tag { color: #6ee7b7; border-color: rgba(52,211,153,.35); }
.setup-line.is-running .setup-line-tag { color: #c7d2fe; border-color: rgba(129,140,248,.5); background: rgba(99,102,241,.2); }

.setup-terminal-progress { display: flex; align-items: center; gap: 12px; padding: 4px 16px 12px; }
.setup-terminal-track { flex: 1; height: 6px; border-radius: 6px; background: rgba(148,163,184,.18); overflow: hidden; }
.setup-terminal-fill {
    display: block; height: 100%; border-radius: 6px;
    background: linear-gradient(90deg, #6366f1, #22d3ee);
    background-size: 200% 100%;
    animation: setup-flow 2.4s linear infinite;
    transition: width .6s ease;
}
@keyframes setup-flow { to { background-position: -200% 0; } }
.setup-fill-1 { width: 4%; }
.setup-fill-2 { width: 33%; }
.setup-fill-3 { width: 67%; }
.setup-fill-4 { width: 100%; }
.setup-terminal-percent { font-size: 11.5px; color: rgba(226,232,240,.7); white-space: nowrap; }
.setup-terminal-prompt {
    padding: 10px 16px 13px; font-size: 12.5px; color: rgba(226,232,240,.75);
    border-top: 1px solid rgba(129,140,248,.14);
}
.setup-terminal-sign { color: #34d399; margin-inline-end: 4px; }
.setup-caret { display: inline-block; width: 8px; height: 15px; background: #a5f3fc; vertical-align: -3px; animation: setup-blink 1s steps(1) infinite; }
@keyframes setup-blink { 50% { opacity: 0; } }

.setup-scan-card {
    position: relative;
    display: flex; align-items: center; gap: 16px;
    padding: 16px 18px; margin-bottom: 8px;
    border-radius: 16px; border: 1px solid var(--lp-border);
    background: var(--lp-surface); overflow: hidden;
}
.setup-scan-card::after {
    content: ''; position: absolute; inset-block: 0; width: 40%; inset-inline-start: -40%;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,.08), transparent);
    animation: setup-sweep 1.4s ease .2s 1 forwards;
}
@keyframes setup-sweep { to { inset-inline-start: 110%; } }
.setup-scan-card.is-ok { border-color: #bbf7d0; background: linear-gradient(135deg, #f0fdf4, var(--lp-surface) 70%); }
.setup-scan-card.is-warn { border-color: #fde68a; background: linear-gradient(135deg, #fffbeb, var(--lp-surface) 70%); }
.setup-scan-card.is-fail { border-color: #fecaca; background: linear-gradient(135deg, #fef2f2, var(--lp-surface) 70%); }
.setup-ring { width: 60px; height: 60px; flex-shrink: 0; transform: rotate(-90deg); }
[dir="rtl"] .setup-ring { transform: rotate(-90deg) scaleY(-1); }
.setup-ring circle { fill: none; stroke-width: 6; }
.setup-ring-track { stroke: var(--lp-border); }
.setup-ring-value { stroke-linecap: round; animation: setup-ring 1s cubic-bezier(.16,1,.3,1) both; }
@keyframes setup-ring { from { stroke-dasharray: 0 100; } }
.is-ok .setup-ring-value { stroke: #10b981; }
.is-warn .setup-ring-value { stroke: #f59e0b; }
.is-fail .setup-ring-value { stroke: #ef4444; }
.setup-ring-icon {
    position: absolute; inset-inline-start: 18px; width: 60px; height: 60px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 22px;
}
.is-ok .setup-ring-icon { color: #059669; }
.is-warn .setup-ring-icon { color: #d97706; }
.is-fail .setup-ring-icon { color: #dc2626; }
.setup-scan-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setup-scan-label {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em; color: var(--lp-text-3);
}
[dir="rtl"] .setup-scan-label { letter-spacing: 0; }
.setup-scan-count { font-size: 17px; font-weight: 800; color: var(--lp-text); letter-spacing: -.2px; }
.setup-scan-status { font-size: 13px; color: var(--lp-text-2); line-height: 1.5; }

.setup-reveal > * { animation: setup-rise .4s ease both; }
.setup-reveal > *:nth-child(2) { animation-delay: .05s; }
.setup-reveal > *:nth-child(3) { animation-delay: .1s; }
.setup-reveal > *:nth-child(4) { animation-delay: .15s; }
.setup-reveal > *:nth-child(5) { animation-delay: .2s; }
.setup-reveal > *:nth-child(6) { animation-delay: .25s; }
.setup-reveal > *:nth-child(7) { animation-delay: .3s; }
.setup-reveal > *:nth-child(8) { animation-delay: .35s; }
.setup-reveal > *:nth-child(9) { animation-delay: .4s; }
.setup-reveal > *:nth-child(10) { animation-delay: .45s; }
.setup-reveal > *:nth-child(11) { animation-delay: .5s; }
.setup-reveal > *:nth-child(12) { animation-delay: .55s; }
.setup-reveal > *:nth-child(n+13) { animation-delay: .6s; }
@keyframes setup-rise { from { opacity: 0; transform: translateY(6px); } }

.setup-mobile-progress { display: none; gap: 6px; margin-bottom: 22px; }
.setup-mobile-progress span { flex: 1; height: 4px; border-radius: 4px; background: var(--lp-border); }
.setup-mobile-progress span.is-on { background: linear-gradient(90deg, var(--lp-brand), var(--lp-brand-2)); }

.setup-section-title {
    font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--lp-text-3); margin: 22px 0 10px;
}
[dir="rtl"] .setup-section-title { letter-spacing: 0; text-transform: none; }

.setup-check-group {
    border: 1px solid var(--lp-border); border-radius: 14px;
    background: var(--lp-surface); overflow: hidden;
}
.setup-check-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
}
.setup-check-row + .setup-check-row { border-top: 1px solid var(--lp-border); }
.setup-check-icon {
    width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.setup-check-row.is-ok .setup-check-icon { background: #ecfdf5; color: #059669; }
.setup-check-row.is-fail .setup-check-icon { background: #fef2f2; color: #dc2626; }
.setup-check-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.setup-check-name { font-size: 13.5px; font-weight: 600; color: var(--lp-text); }
code.setup-check-name { background: none; padding: 0; }
.setup-check-desc { font-size: 12.5px; color: var(--lp-text-2); }

.setup-badge {
    font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.setup-badge.is-ok { background: #ecfdf5; color: #047857; }
.setup-badge.is-fail { background: #fef2f2; color: #b91c1c; }

.setup-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.setup-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 11px; border-radius: 10px;
    font-size: 13px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    border: 1px solid var(--lp-border); background: var(--lp-surface); color: var(--lp-text);
}
.setup-chip small { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 10.5px; color: var(--lp-text-3); }
.setup-chip.is-ok i { color: #10b981; }
.setup-chip.is-fail { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.setup-chip.is-fail i { color: #dc2626; }
.setup-chip.is-warn { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.setup-chip.is-warn i { color: #d97706; }

.setup-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 14px; }
.setup-grid > .auth-field { grid-column: span 12; }
.setup-grid > .setup-col-4 { grid-column: span 4; }
.setup-grid > .setup-col-6 { grid-column: span 6; }
.setup-grid > .setup-col-8 { grid-column: span 8; }

.setup-hint { display: block; font-size: 12px; color: var(--lp-text-3); margin-top: 6px; }
.setup-page .auth-field .invalid-feedback:empty { display: none; }
.setup-page .auth-input[type="number"] { -moz-appearance: textfield; }

.setup-panel {
    border: 1px solid var(--lp-border); border-radius: 16px;
    background: var(--lp-surface);
    padding: 20px 20px 4px;
    margin-bottom: 16px;
}
.setup-panel-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 15px; font-weight: 700; color: var(--lp-text);
    margin-bottom: 16px;
}
.setup-panel-hint { font-size: 13px; color: var(--lp-text-2); margin: -10px 0 16px; }
.setup-panel-icon {
    width: 32px; height: 32px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--lp-brand-lt); color: var(--lp-brand); font-size: 15px;
}

.setup-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin-top: 26px;
}
.setup-actions-end { display: flex; gap: 10px; flex-wrap: wrap; margin-inline-start: auto; }
.setup-btn-next { width: auto; padding: 0 24px; text-decoration: none; margin-inline-start: auto; }
.setup-actions-end .setup-btn-next { margin-inline-start: 0; }
a.setup-btn-next:hover { color: #fff; }
.setup-btn-ghost, .setup-btn-outline {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 50px; padding: 0 18px; border-radius: 12px;
    font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
    transition: background .18s, border-color .18s, color .18s;
}
.setup-btn-ghost { background: transparent; border: none; color: var(--lp-text-2); padding: 0 8px; }
.setup-btn-ghost:hover { color: var(--lp-brand); }
.setup-btn-outline { background: var(--lp-surface); border: 1.5px solid var(--lp-border); color: var(--lp-text); }
.setup-btn-outline:hover { border-color: var(--lp-brand); color: var(--lp-brand); }
.setup-btn-ghost:disabled, .setup-btn-outline:disabled { opacity: .6; cursor: not-allowed; }
[dir="rtl"] .setup-arrow { transform: scaleX(-1); }

.setup-test-result {
    display: flex; align-items: flex-start; gap: 9px;
    border-radius: 12px; padding: 12px 14px; margin-top: 4px;
    font-size: 13.5px; line-height: 1.5;
}
.setup-test-result.is-ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.setup-test-result.is-fail { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.setup-ready {
    display: flex; gap: 14px; align-items: flex-start;
    border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: 16px; padding: 18px;
}
.setup-ready-icon {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: #10b981; color: #fff; font-size: 20px;
}
.setup-ready-title { font-weight: 700; color: #065f46; margin-bottom: 4px; }
.setup-ready-text { margin: 0; font-size: 13.5px; color: #047857; line-height: 1.55; }

.setup-strength { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.setup-strength-bar { flex: 0 0 90px; height: 5px; border-radius: 5px; background: var(--lp-border); overflow: hidden; }
.setup-strength-bar span { display: block; height: 100%; width: 0; border-radius: 5px; transition: width .25s, background .25s; }
.setup-strength-label { font-size: 12px; color: var(--lp-text-3); }
.setup-strength.is-weak .setup-strength-bar span { width: 33%; background: #ef4444; }
.setup-strength.is-fair .setup-strength-bar span { width: 66%; background: #f59e0b; }
.setup-strength.is-strong .setup-strength-bar span { width: 100%; background: #10b981; }
.setup-strength.is-weak .setup-strength-label { color: #dc2626; }
.setup-strength.is-fair .setup-strength-label { color: #b45309; }
.setup-strength.is-strong .setup-strength-label { color: #047857; }

.setup-page .select2-container { width: 100% !important; }
.setup-page .select2-container--default .select2-selection--single {
    height: 50px; border: 1.5px solid var(--lp-border); border-radius: 12px;
    background: var(--lp-surface); display: flex; align-items: center;
    transition: border-color .18s, box-shadow .18s;
}
.setup-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.4; padding-inline: 16px 36px; font-size: 14.5px; color: var(--lp-text);
}
.setup-page .select2-container--default .select2-selection--single .select2-selection__arrow { height: 48px; inset-inline-end: 8px; }
.setup-page .select2-container--default.select2-container--open .select2-selection--single,
.setup-page .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--lp-brand); box-shadow: 0 0 0 4px var(--lp-ring);
}
.setup-page .select2-selection.is-invalid { border-color: #ef4444 !important; }
.select2-dropdown { border-color: var(--lp-border); border-radius: 12px; overflow: hidden; box-shadow: var(--lp-sh-lg); }
.select2-search--dropdown .select2-search__field { border-radius: 8px; border-color: var(--lp-border); padding: 7px 10px; }
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--lp-brand); }

.setup-done { text-align: center; margin-bottom: 8px; }
.setup-done-icon {
    width: 76px; height: 76px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #10b981, #059669); color: #fff; font-size: 38px;
    box-shadow: 0 0 0 10px rgba(16,185,129,.12), 0 14px 30px -8px rgba(5,150,105,.55);
    margin: 6px 0 22px;
    animation: setup-pop .55s cubic-bezier(.16,1,.3,1) both;
}
@keyframes setup-pop { from { transform: scale(.4); opacity: 0; } }
.setup-next { list-style: none; margin: 0; padding: 0 0 12px; }
.setup-next li {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 0; font-size: 14px; color: var(--lp-text-2);
}
.setup-next li + li { border-top: 1px dashed var(--lp-border); }
.setup-next i { color: var(--lp-brand); font-size: 16px; }

.setup-overlay {
    position: fixed; inset: 0; z-index: 1080;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.setup-overlay-card {
    width: 100%; max-width: 380px; text-align: center;
    background: var(--lp-surface); border-radius: 20px; padding: 34px 28px;
    box-shadow: var(--lp-sh-lg);
}
.setup-overlay-spinner {
    display: inline-block; width: 46px; height: 46px; border-radius: 50%;
    border: 4px solid var(--lp-brand-lt); border-top-color: var(--lp-brand);
    animation: auth-spin .8s linear infinite; margin-bottom: 18px;
}
.setup-overlay-title { font-size: 18px; font-weight: 800; color: var(--lp-text); margin: 0 0 8px; }
.setup-overlay-text { font-size: 13.5px; color: var(--lp-text-2); margin: 0; line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
    .setup-showcase .setup-tech-img, .setup-scan, .setup-pulse, .setup-line, .setup-terminal-fill,
    .setup-caret, .setup-scan-card::after, .setup-ring-value, .setup-reveal > * { animation: none; }
    .setup-scan { display: none; }
}

@media (max-width: 991.98px) {
    .setup-mobile-progress { display: flex; }
    .setup-card { max-width: 560px; }
    .setup-card--wide { max-width: 640px; }
}

@media (max-width: 575.98px) {
    .setup-grid > .setup-col-4,
    .setup-grid > .setup-col-6,
    .setup-grid > .setup-col-8 { grid-column: span 12; }
    .setup-panel { padding: 16px 14px 2px; }
    .setup-actions { flex-direction: column-reverse; align-items: stretch; }
    .setup-actions-end { flex-direction: column-reverse; margin-inline-start: 0; }
    .setup-btn-next, .setup-btn-outline { width: 100%; }
}

.setup-showcase .auth-showcase-title { font-size: clamp(24px, 1.2rem + 1vw, 32px); margin-bottom: 10px; }
.setup-showcase .auth-showcase-text { font-size: 14px; margin-bottom: 0; }
.setup-showcase .auth-showcase-inner { padding: 32px 44px; }
.setup-showcase .auth-showcase-foot { margin-top: 24px; }
.setup-showcase .setup-kicker { margin-bottom: 14px; }
.setup-showcase .setup-terminal { margin-top: 20px; }
.setup-showcase .setup-line { padding: 7px 10px; }

@media (max-height: 760px) {
    .setup-showcase .auth-showcase-text, .setup-line-desc { display: none; }
}

@media (min-width: 992px) {
    .setup-showcase { position: sticky; top: 0; height: 100vh; min-height: 0; align-self: start; }
    .setup-showcase .setup-intro { margin-block: auto; }
}

@media (max-width: 480px) {
    .setup-page .auth-main { padding-top: 24px; padding-bottom: 24px; }
}
