*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0b0c10;
    --card: #12141a;
    --muted: #a5adbf;
    --accent: #ffd166;
    --accent-2: #ef476f;
    --ok: #06d6a0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html,
body {
    height: 100%;
}

body {
    font-family:
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        Inter,
        Arial,
        sans-serif;
    background:
        radial-gradient(
            1200px 600px at 10% 10%,
            rgba(255, 255, 255, 0.06),
            transparent
        ),
        radial-gradient(
            800px 400px at 90% 20%,
            rgba(239, 71, 111, 0.08),
            transparent
        ),
        var(--bg);
    color: #fff;
}

a {
    color: inherit;
    text-decoration: none;
}

[hidden] {
    display: none !important;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.2));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav {
    max-width: 1024px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.brand .logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), #ff7a00);
    color: #000;
    font-weight: 900;
    box-shadow: var(--shadow);
}

.pulse {
    position: relative;
}
.pulse::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    border: 2px solid rgba(255, 209, 102, 0.35);
    filter: blur(2px);
    animation: pulse 2.2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    70% {
        opacity: 0;
        transform: scale(1.15);
    }
    100% {
        opacity: 0;
    }
}

.wrap {
    max-width: 1024px;
    margin: 22px auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
}
@media (max-width: 880px) {
    .wrap {
        grid-template-columns: 1fr;
    }
}

.card {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.02),
        rgba(255, 255, 255, 0)
    );
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 18px;
}

.hero {
    position: relative;
    overflow: hidden;
}
.hero .banner {
    height: 220px;
    border-radius: 16px;
    background: linear-gradient(135deg, #23272f, #14161a);
    display: grid;
    place-items: center;
    margin-bottom: 14px;
}

.badge {
    font-size: 12px;
    opacity: 0.9;
    color: #000;
    background: var(--accent);
    padding: 6px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.title {
    font-size: clamp(22px, 6vw, 34px);
    margin: 8px 0 6px;
    line-height: 1.15;
}
.subtitle {
    color: var(--muted);
    margin-bottom: 16px;
}

.grid {
    display: grid;
    gap: 12px;
}
label {
    font-size: 13px;
    opacity: 0.85;
    display: block;
    margin-bottom: 6px;
}

input,
select {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #0f1116;
    color: #fff;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
}
input:focus,
select:focus {
    border-color: var(--accent);
}
input::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 560px) {
    .row {
        grid-template-columns: 1fr;
    }
}

.phone-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    padding: 0 12px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    transition:
        max-height 0.28s ease,
        opacity 0.22s ease,
        margin-top 0.24s ease,
        padding 0.24s ease,
        background 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

.phone-status::before {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.phone-status.valid {
    max-height: 44px;
    opacity: 1;
    margin-top: 8px;
    padding: 9px 12px;
    color: var(--ok);
    background: rgba(6, 214, 160, 0.08);
    border-color: rgba(6, 214, 160, 0.28);
    box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.06);
}
.phone-status.valid::before {
    content: "✓";
    background: rgba(6, 214, 160, 0.18);
    color: var(--ok);
}

.phone-status.invalid {
    max-height: 44px;
    opacity: 1;
    margin-top: 8px;
    padding: 9px 12px;
    color: var(--accent-2);
    background: rgba(239, 71, 111, 0.08);
    border-color: rgba(239, 71, 111, 0.28);
    box-shadow: 0 0 0 3px rgba(239, 71, 111, 0.06);
}
.phone-status.invalid::before {
    content: "⚠";
    background: rgba(239, 71, 111, 0.18);
    color: var(--accent-2);
}

.phone-status.error {
    max-height: 44px;
    opacity: 1;
    margin-top: 8px;
    padding: 9px 12px;
    color: var(--accent-2);
    background: rgba(239, 71, 111, 0.08);
    border-color: rgba(239, 71, 111, 0.28);
    box-shadow: 0 0 0 3px rgba(239, 71, 111, 0.06);
}
.phone-status.error::before {
    content: "!";
    background: rgba(239, 71, 111, 0.18);
    color: var(--accent-2);
}

/* CTA Buttons */
.cta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 14px 16px;
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s transform;
    font-family: inherit;
    font-size: 0.95rem;
}
.btn.primary {
    background: linear-gradient(135deg, var(--accent), #ff7a00);
    color: #000;
}
.btn.primary:hover {
    transform: translateY(-1px);
}
.btn.ghost {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    color: #fff;
}

.steps {
    display: flex;
    gap: 8px;
    margin: 14px 0 0;
    flex-wrap: wrap;
}
.chip {
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #0e1015;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.side .meter {
    height: 10px;
    border-radius: 999px;
    background: #0e1015;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.side .fill {
    height: 100%;
    width: 36%;
    background: linear-gradient(90deg, var(--ok), #00c2ff);
    animation: grow 6s linear infinite;
}
@keyframes grow {
    0% {
        width: 12%;
    }
    50% {
        width: 82%;
    }
    100% {
        width: 12%;
    }
}

.live {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: #0e1015;
}
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff3b30;
    box-shadow: 0 0 10px #ff3b30;
    animation: bl 1.2s infinite;
}
@keyframes bl {
    50% {
        opacity: 0.3;
    }
}

.list {
    display: grid;
    gap: 10px;
    max-height: 240px;
    overflow: auto;
    padding-right: 6px;
}
.item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: #0e1015;
}
.item small {
    color: var(--muted);
}

.toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    background: #0e1015;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 14px;
    display: none;
    z-index: 999;
}

.theme-strip {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, #6a11cb, #2575fc);
}

.step-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.step-card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    padding: 40px 32px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow);
}

.step-title {
    font-size: 1.55rem;
    font-weight: 700;
    text-align: center;
    color: var(--accent);
    margin-bottom: 10px;
}

.step-text {
    text-align: center;
    color: var(--muted);
    font-size: 0.93rem;
    margin-bottom: 18px;
    line-height: 1.6;
}

.waiting-phone {
    text-align: center;
    font-size: 1.05rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 8px;
}

.loader {
    display: flex;
    justify-content: center;
    gap: 9px;
    margin: 28px 0 20px;
}
.loader span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent);
    animation: ldot 1.2s ease-in-out infinite;
}
.loader span:nth-child(2) {
    animation-delay: 0.16s;
}
.loader span:nth-child(3) {
    animation-delay: 0.32s;
}
@keyframes ldot {
    0%,
    100% {
        transform: scale(0.45);
        opacity: 0.35;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
}

.pair-code {
    text-align: center;
    font-family: "Courier New", monospace;
    font-size: clamp(26px, 8vw, 40px);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent);
    background: rgba(255, 209, 102, 0.06);
    border: 1px solid rgba(255, 209, 102, 0.22);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 18px 0;
    user-select: all;
}

.pair-actions {
    text-align: center;
    margin-bottom: 20px;
}

.btn-mini {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid rgba(255, 209, 102, 0.35);
    border-radius: 999px;
    background: transparent;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s,
        color 0.2s;
    font-family: inherit;
}
.btn-mini:hover {
    background: rgba(255, 209, 102, 0.08);
}
.btn-mini.copied {
    color: var(--ok);
    border-color: var(--ok);
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.btn-link:hover {
    color: rgba(255, 209, 102, 0.7);
}

.howto {
    border: 1px solid rgba(255, 209, 102, 0.12);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.howto-line {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 7px 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    border-bottom: 1px dashed rgba(255, 209, 102, 0.1);
}
.howto-line:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.howto-num {
    flex-shrink: 0;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.howto-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 13px;
    border-radius: 9px;
    background: rgba(255, 209, 102, 0.06);
    border: 1px solid rgba(255, 209, 102, 0.18);
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.55;
}

.tip-label {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(255, 209, 102, 0.14);
    border-radius: 5px;
    padding: 3px 7px;
    margin-top: 1px;
}

.conn-status {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}
.footnote {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-layer {
    display: none;
}
#step-code.is-loading .skeleton-layer {
    display: block;
}
#step-code.is-loading .code-content {
    display: none;
}

.code-content {
    animation: code-fadein 0.22s ease;
}
@keyframes code-fadein {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.skel {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.04) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.04) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: 8px;
}

.skel-title {
    height: 26px;
    width: 62%;
    margin: 0 auto 22px;
}
.skel-code-display {
    height: 76px;
    border-radius: 12px;
    margin-bottom: 18px;
}
.skel-center {
    text-align: center;
    margin-bottom: 20px;
}
.skel-copy {
    height: 34px;
    width: 128px;
    border-radius: 999px;
    display: inline-block;
}
.skel-instructions {
    border-radius: 10px;
    margin-bottom: 14px;
    padding: 10px 14px;
}
.skel-inner-line {
    height: 13px;
    border-radius: 6px;
    margin: 9px 0;
    background: rgba(255, 255, 255, 0.06);
}
.skel-inner-line--short {
    width: 70%;
}
.skel-tip-block {
    height: 46px;
    border-radius: 9px;
    margin-bottom: 14px;
}
.skel-conn {
    height: 13px;
    width: 58%;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 4px;
}
.skel-foot {
    height: 12px;
    width: 44%;
    border-radius: 6px;
    display: inline-block;
}

.success-icon {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ok), #00a37a);
    color: white;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}

.error-icon {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-2), #c92a52);
    color: white;
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}

.claimed-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff7a00);
    color: #000;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 0 0 8px rgba(255, 209, 102, 0.1);
}

.claimed-greeting {
    text-align: center;
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 18px;
}
.claimed-greeting strong {
    color: var(--accent);
}

.claimed-checklist {
    list-style: none;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    padding: 6px 14px;
    margin-bottom: 18px;
}
.claimed-checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    font-size: 0.9rem;
    color: var(--muted);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
}
.claimed-checklist li:last-child {
    border-bottom: none;
}
.claimed-checklist .check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--ok);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.claimed-note {
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 18px;
}
.claimed-reset {
    text-align: center;
}

.step-card .btn {
    flex: none;
    width: 100%;
    margin-top: 4px;
}

@media (max-width: 520px) {
    .step-card {
        padding: 26px 18px;
        border-radius: 14px;
    }
    .step-title {
        font-size: 1.3rem;
    }
}
