:root {
    --accent:#ff8c00; /* CI orange */
    --blue1:#007bff;  /* CI blue */
    --blue2:#00d4ff;  /* CI blue grad end */
    --bg: #0d1018;
    --card: #151a25;
    --muted: #8fa0b5;
    --border: #1f2533;
    --radius: 14px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;

    color: #e9eff7;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}
.shell {
    width: min(640px, 94vw);
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.card {
    background: linear-gradient(180deg, #141414, #1a1a1a);
    border-radius: 16px;
    box-shadow: 0 10px 32px rgba(0,0,0,.55);
    padding: 24px;
    border: 1px solid #232323;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    grid-column: span 2;
    padding: 6px 4px;
}
h1 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0.35px;
}
button, select, input {
    font: inherit;
    color: #e9eff7;
}
.btn {
    background: var(--accent);
    color: #0d1018;
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
    box-shadow: 0 10px 30px rgba(246, 164, 31, 0.25);
}
.btn:active { transform: scale(0.98); }
.btn.secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border);
    box-shadow: none;
}
label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--muted);
}
input[type="text"], input[type="password"], select {
    width: 100%;
    background: #0f1420;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    outline: none;
    transition: border 120ms ease, box-shadow 120ms ease;
}
input:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(246, 164, 31, 0.15);
}
.field { margin-bottom: 14px; }
.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.switch input { display: none; }
.toggle {
    width: 46px; height: 26px;
    background: #0f1420;
    border-radius: 20px;
    border: 1px solid var(--border);
    position: relative;
    transition: border 120ms ease, background 120ms ease;
}
.toggle::after {
    content: "";
    position: absolute;
    top: 3px; left: 4px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #e9eff7;
    transition: transform 140ms ease, background 140ms ease;
}
.switch input:checked + .toggle {
    border-color: var(--accent);
    background: rgba(246, 164, 31, 0.1);
}
.switch input:checked + .toggle::after {
    transform: translateX(18px);
    background: var(--accent);
}
.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.muted { color: var(--muted); font-size: 13px; }
.qr-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}
.qr-box {
    background: #0f1420;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    width: 100%;
    padding: 20px;
    min-height: 280px;
    display: grid;
    place-items: center;
}
img#qrImage {
    width: 240px;
    max-width: 100%;
    height: auto;
    image-rendering: crisp-edges;
}
.alert { color: #ff7b7b; font-size: 13px; min-height: 18px; }
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .header { grid-column: span 1; }
}
@media (max-width: 540px) {
    body { padding: 16px; }
    .card { padding: 16px; }
    .row { grid-template-columns: 1fr; }
    .actions { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; text-align: center; }
}
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    background: #1a1a1a;
    color: #a4aab1;
    border: 1px solid #232323;
    transition: all 0.15s ease;
}

.tab:hover {
    color: #fff;
    border-color: #2b2b2b;
}

.tab.active {
    background: linear-gradient(45deg, var(--blue1), var(--blue2));
    color: #fff;
    border: none;
}
.bg-guard {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.shell, .tabs {
    position: relative;
    z-index: 1;
}