/* =============================================
   CSS VARIABLES & RESET
   ============================================= */
:root {
    --bg: #060a13;
    --surface: #0e1527;
    --surface2: #131e35;
    --border: rgba(255, 255, 255, 0.07);
    --border2: rgba(255, 255, 255, 0.12);
    --primary: #25d366;
    --primary-d: #1aab52;
    --primary-glow: rgba(37, 211, 102, 0.25);
    --blue: #3b82f6;
    --danger: #ef4444;
    --text: #f1f5f9;
    --text2: #94a3b8;
    --text3: #475569;
    --sidebar-w: 260px;
    --topbar-h: 65px;
    --radius: 14px;
    --radius-sm: 8px;
    --trans: 0.2s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* =============================================
   ANIMATED BACKGROUND ORBS
   ============================================= */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    animation: float 20s infinite alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(37, 211, 102, 0.07);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: rgba(59, 130, 246, 0.06);
    bottom: -100px;
    right: -50px;
    animation-delay: -7s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: rgba(168, 85, 247, 0.05);
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 40px) scale(1.1);
    }
}

/* =============================================
   PAGES
   ============================================= */
.page {
    display: none;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.page.active {
    display: flex;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
#login-page {
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.8rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: var(--primary-glow);
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.brand-icon svg {
    width: 22px;
    height: 22px;
    fill: var(--primary);
}

.brand-icon.small {
    width: 32px;
    height: 32px;
}

.brand-icon.small svg {
    width: 18px;
    height: 18px;
}

.card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.subtitle {
    color: var(--text2);
    font-size: 0.9rem;
    margin-bottom: 2rem !important;
}

/* =============================================
   FORM ELEMENTS
   ============================================= */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text2);
    letter-spacing: 0.02em;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    padding: 0.75rem 0.9rem 0.75rem 2.6rem;
    outline: none;
    transition: border-color var(--trans), box-shadow var(--trans);
}

.input-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-wrap input::placeholder {
    color: var(--text3);
}

.input-icon {
    position: absolute;
    left: 0.8rem;
    width: 18px;
    height: 18px;
    stroke: var(--text3);
    pointer-events: none;
    flex-shrink: 0;
}

.eye-btn {
    position: absolute;
    right: 0.8rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: grid;
    place-items: center;
}

.eye-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--text3);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--trans);
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    width: 100%;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-d);
    transform: translateY(-1px);
    box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-outline {
    background: transparent;
    color: var(--text2);
    border: 1px solid var(--border2);
}

.btn-outline:hover {
    background: var(--surface2);
    color: var(--text);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    transition: background var(--trans);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--text2);
}

/* =============================================
   MESSAGES
   ============================================= */
.error-msg {
    color: var(--danger);
    font-size: 0.82rem;
    min-height: 1.2em;
}

.success-msg {
    color: var(--primary);
    font-size: 0.82rem;
    min-height: 1.2em;
}

/* =============================================
   DASHBOARD LAYOUT
   ============================================= */
#dashboard-page {
    flex-direction: row;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--trans);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
}

.sidebar-close svg {
    width: 20px;
    height: 20px;
    stroke: var(--text2);
}

.sidebar-close:hover {
    background: var(--surface2);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--text2);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--trans);
    cursor: pointer;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--surface2);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(37, 211, 102, 0.2);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-glow);
    border: 1px solid rgba(37, 211, 102, 0.3);
    color: var(--primary);
    font-weight: 700;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.admin-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text3);
}

.logout-btn svg {
    stroke: var(--text3);
}

.logout-btn:hover svg {
    stroke: var(--danger);
}

/* MAIN CONTENT */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* TOPBAR */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
}

.hamburger svg {
    width: 22px;
    height: 22px;
    stroke: var(--text);
}

.hamburger:hover {
    background: var(--surface2);
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    flex: 1;
}

.status-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text3);
}

.status-chip.connected .status-dot {
    background: var(--primary);
    box-shadow: 0 0 6px var(--primary);
}

.status-chip.connected {
    color: var(--primary);
    border-color: rgba(37, 211, 102, 0.3);
    background: var(--primary-glow);
}

/* CONTENT AREA */
.content {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: 900px;
}

/* TAB CONTENT */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   SECTION HEADER
   ============================================= */
.section-header {
    margin-bottom: 1.75rem;
}

.section-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.section-header p {
    color: var(--text2);
    font-size: 0.9rem;
}

/* =============================================
   CONNECT TAB
   ============================================= */
.connect-step {
    display: none;
}

.connect-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* QR Box */
.qr-box {
    background: #fff;
    border-radius: var(--radius);
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

#qrImage {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
    animation: fadeIn 0.4s ease;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text3);
    font-size: 0.85rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(37, 211, 102, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Card */
.success-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 480px;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid rgba(37, 211, 102, 0.25);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--primary);
}

.success-icon svg {
    width: 30px;
    height: 30px;
}

.success-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
}

.success-card p {
    color: var(--text2);
}

.success-card strong {
    color: var(--primary);
}

/* =============================================
   COMMANDS TAB
   ============================================= */
.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.cmd-card {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color var(--trans);
}

.cmd-card:hover {
    border-color: rgba(37, 211, 102, 0.3);
}

.cmd-tag {
    display: inline-block;
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(37, 211, 102, 0.25);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.6rem;
    font-family: monospace;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.cmd-card p {
    color: var(--text2);
    font-size: 0.88rem;
    margin-bottom: 0.75rem;
}

.cmd-response {
    font-size: 0.82rem;
    color: var(--text3);
    border-top: 1px solid var(--border);
    padding-top: 0.6rem;
}

.cmd-response em {
    color: var(--text2);
    font-style: italic;
}

/* =============================================
   API TAB
   ============================================= */
.api-doc-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.api-method {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    padding: 0.25rem 0.65rem;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.api-url {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text);
    word-break: break-all;
}

.params-table {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.param-row {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.param-row:last-child {
    border-bottom: none;
}

.param-row.header {
    background: var(--surface2);
    font-weight: 600;
    color: var(--text2);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.param-row code {
    font-family: monospace;
    color: var(--primary);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.required {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge.optional {
    background: var(--surface2);
    color: var(--text3);
    border: 1px solid var(--border);
}

.api-tip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(37, 211, 102, 0.06);
    border: 1px solid rgba(37, 211, 102, 0.15);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    color: var(--text2);
    margin-bottom: 1rem;
}

.api-tip svg {
    width: 18px;
    height: 18px;
    stroke: var(--primary);
    flex-shrink: 0;
}

.api-tip code {
    background: var(--surface2);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--primary);
}

.example-block {
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.example-label {
    padding: 0.4rem 1rem;
    background: var(--surface2);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.example-block pre {
    padding: 1rem;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text2);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* =============================================
   SETTINGS TAB
   ============================================= */
.settings-card {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 1.75rem;
    max-width: 680px;
}

/* =============================================
   API KEYS TAB
   ============================================= */
.new-key-banner {
    background: rgba(37, 211, 102, 0.08);
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease;
}

.new-key-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.new-key-header svg {
    width: 18px;
    height: 18px;
    stroke: var(--primary);
    flex-shrink: 0;
}

.key-reveal-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
}

.key-reveal-wrap code {
    flex: 1;
    font-family: monospace;
    font-size: 0.88rem;
    color: var(--text);
    word-break: break-all;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 6px;
    color: var(--text2);
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    cursor: pointer;
    transition: all var(--trans);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-copy svg {
    width: 15px;
    height: 15px;
}

.btn-copy:hover {
    background: var(--primary-glow);
    border-color: rgba(37, 211, 102, 0.3);
    color: var(--primary);
}

/* Key rows list */
.key-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    animation: fadeIn 0.25s ease;
}

.key-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.key-row:first-child {
    padding-top: 0;
}

.key-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
    flex: 1;
}

.key-label-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.key-masked {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text3);
    word-break: break-all;
}

.key-date {
    font-size: 0.77rem;
    color: var(--text3);
}

.btn-revoke {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    color: var(--danger);
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    cursor: pointer;
    transition: all var(--trans);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-revoke svg {
    width: 14px;
    height: 14px;
}

.btn-revoke:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.4);
}

.empty-state {
    color: var(--text3);
    font-size: 0.88rem;
    padding: 1rem 0;
    text-align: center;
}

/* =============================================
   SIDEBAR OVERLAY (mobile)
   ============================================= */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 99;
    backdrop-filter: blur(3px);
}

.sidebar-overlay.active {
    display: block;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5);
    }

    .sidebar-close {
        display: block;
    }

    .main {
        margin-left: 0;
    }

    .hamburger {
        display: block;
    }

    .content {
        padding: 1.25rem 1rem;
    }

    .param-row {
        grid-template-columns: 1fr 1fr;
        font-size: 0.82rem;
    }

    .param-row span:last-child {
        grid-column: 1/-1;
        color: var(--text3);
    }

    .param-row.header span:last-child {
        display: none;
    }

    .commands-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 2rem 1.25rem;
    }

    .qr-box {
        width: 240px;
        height: 240px;
    }

    .api-doc-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =============================================
   SELECTION UI
   ============================================= */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.selection-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.selection-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    background: var(--surface2);
}

.selection-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.selection-card:hover::after {
    opacity: 1;
}

.selection-icon {
    width: 64px;
    height: 64px;
    background: var(--bg);
    border-radius: 16px;
    display: grid;
    place-items: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.selection-card h4 {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.selection-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.input-section {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 480px;
}

/* =============================================
   PAIRING CODE
   ============================================= */
.pairing-box {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 500px;
    margin-top: 1rem;
}

.pairing-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.code-segment {
    width: 45px;
    height: 60px;
    background: var(--bg);
    border: 2px solid var(--border2);
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#code-divider {
    width: 15px;
    height: 4px;
    background: var(--text3);
    border: none;
    border-radius: 2px;
    margin: 0 5px;
}

.pairing-hint {
    font-size: 0.85rem;
    color: var(--text3);
    text-align: center;
}

@media (max-width: 480px) {
    .code-segment {
        width: 38px;
        height: 50px;
        font-size: 1.4rem;
    }
}