:root {
    color-scheme: dark;
    --bg: #06111c;
    --panel: rgba(12, 28, 42, 0.88);
    --panel-soft: rgba(20, 40, 56, 0.68);
    --border: rgba(152, 178, 197, 0.16);
    --text: #f3f7fa;
    --muted: #91a5b5;
    --accent: #e34a38;
    --accent-dark: #b93628;
    --success: #34d399;
    --offline: #667887;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 0%, rgba(227, 74, 56, 0.14), transparent 30%),
        radial-gradient(circle at 88% 12%, rgba(40, 120, 160, 0.12), transparent 28%),
        var(--bg);
}

button, input, select { font: inherit; }

.setup-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 56px;
}

.setup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
}

.brand img { display: block; width: 132px; height: auto; }

.back-link {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover { color: #fff; }

.hero {
    max-width: 710px;
    padding: 72px 0 34px;
}

.eyebrow {
    color: #ff8b7e;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 10px 0 12px;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.hero p {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.55;
}

.setup-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(18px);
}

.card-heading {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 22px;
}

.step-number {
    display: grid;
    width: 31px;
    height: 31px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: var(--accent);
    font-size: 13px;
    font-weight: 800;
}

.card h2 { margin: 0 0 4px; font-size: 19px; }
.card-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.field {
    display: grid;
    gap: 7px;
    margin-top: 15px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.field input,
.field select {
    width: 100%;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    color: var(--text);
    background: #0a1b29;
    text-transform: none;
}

.field input:focus,
.field select:focus { border-color: rgba(227, 74, 56, 0.7); }

.field small {
    color: #718797;
    font-size: 11px;
    font-weight: 550;
    letter-spacing: 0;
    line-height: 1.4;
    text-transform: none;
}

.prepare-room {
    width: 100%;
    min-height: 46px;
    margin-top: 18px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: var(--accent);
    cursor: pointer;
    font-weight: 800;
}

.prepare-room:hover { background: var(--accent-dark); }

.room-state {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
}

.state-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--offline);
}

.room-state[data-ready="true"] { color: var(--success); }
.room-state[data-ready="true"] .state-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.12); }

.copy-field {
    display: grid;
    gap: 7px;
    margin-top: 15px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

.copy-field > div {
    display: flex;
    align-items: center;
    min-height: 48px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #081722;
}

.copy-field code {
    min-width: 0;
    padding: 12px 14px;
    flex: 1;
    overflow: hidden;
    color: #d9e9f3;
    font-size: 13px;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

.copy-field button,
.copy-all {
    border: 0;
    color: #fff;
    background: var(--accent);
    cursor: pointer;
    font-weight: 800;
}

.copy-field button { align-self: stretch; padding: 0 14px; }
.copy-field button:hover, .copy-all:hover { background: var(--accent-dark); }

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.copy-all {
    width: 100%;
    min-height: 44px;
    margin-top: 17px;
    border-radius: 12px;
}

.instructions {
    display: grid;
    gap: 13px;
    margin: 0;
    padding-left: 28px;
    color: #d9e4eb;
    line-height: 1.5;
}

.instructions li::marker { color: #ff7969; font-weight: 800; }

.quality-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin: 0;
}

.quality-grid div {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-soft);
}

.quality-grid dt { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.quality-grid dd { margin: 5px 0 0; font-size: 13px; font-weight: 750; }

.tip {
    margin: 15px 0 0;
    padding: 12px 13px;
    border-left: 3px solid var(--accent);
    color: var(--muted);
    background: rgba(227, 74, 56, 0.07);
    font-size: 13px;
    line-height: 1.5;
}

.toast {
    position: fixed;
    z-index: 20;
    right: 20px;
    bottom: 20px;
    max-width: calc(100% - 40px);
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #fff;
    background: #172b3a;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 160ms ease, transform 160ms ease;
    pointer-events: none;
}

.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 780px) {
    .setup-layout { grid-template-columns: 1fr; }
    .hero { padding-top: 46px; }
}

@media (max-width: 480px) {
    .setup-shell { width: min(100% - 20px, 1120px); padding-top: 14px; }
    .brand img { width: 108px; }
    .back-link { font-size: 12px; }
    .hero p { font-size: 16px; }
    .card { padding: 18px; border-radius: 16px; }
    .quality-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
