:root {
    --brand: #ef5350;
    --brand-dark: #d93a3a;
    --red-50: #fff5f5;
    --red-100: #ffe3e3;
    --red-200: #fecaca;
    --red-300: #fca5a5;
    --bg: #fff5f5;
    --surface: #ffffff;
    --input-bg: #fff8f8;
    --text: #2b1b1b;
    --muted: #7a6464;
    --border: #f3d3d3;
    --shadow: 0 14px 36px rgba(217, 58, 58, .14);
    --shadow-lg: 0 30px 70px -20px rgba(180, 40, 40, .32), 0 8px 20px rgba(217, 58, 58, .08);
    --header-from: #f26767;
    --header-to: #dc3f3f;
    --ok: #16a34a;
    --warn: #d97706;
}

[data-theme="dark"] {
    --bg: #1d1315;
    --surface: #2a1b1e;
    --input-bg: #34222a;
    --text: #fbeaea;
    --muted: #c9a5a8;
    --border: #4a2f33;
    --shadow: 0 12px 32px rgba(0, 0, 0, .45);
    --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .7);
    --header-from: #b93a3d;
    --header-to: #8f2a2d;
}

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

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

button {
    font: inherit;
    cursor: pointer;
}

.i {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* ───────────── Login page ───────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(700px 420px at 12% 8%, rgba(255, 255, 255, .85), transparent 60%),
        radial-gradient(600px 500px at 90% 95%, rgba(239, 83, 80, .28), transparent 62%),
        linear-gradient(135deg, #fff4f4 0%, #ffdede 55%, #fbbcbc 100%);
}

[data-theme="dark"] .login-page {
    background:
        radial-gradient(700px 420px at 12% 8%, rgba(239, 83, 80, .12), transparent 60%),
        radial-gradient(600px 500px at 90% 95%, rgba(239, 83, 80, .18), transparent 62%),
        linear-gradient(135deg, #1d1315 0%, #2b1618 60%, #401d20 100%);
}

.rings {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 1px dashed rgba(220, 63, 63, .28);
    left: 70%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.ring.r1 {
    width: 480px;
    height: 480px;
}

.ring.r2 {
    width: 680px;
    height: 680px;
    border-style: solid;
    border-color: rgba(220, 63, 63, .12);
}

.ring.r3 {
    width: 900px;
    height: 900px;
    border-color: rgba(220, 63, 63, .14);
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    padding: 88px 32px 40px;
    position: relative;
    z-index: 1;
}

.hero-copy {
    max-width: 500px;
    animation: rise .6s ease both;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: .68rem;
    letter-spacing: .24em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--brand-dark);
}

.eyebrow::before {
    content: '';
    width: 28px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand);
}

.hero-copy h1 {
    font-size: clamp(2.1rem, 4.6vw, 3.1rem);
    line-height: 1.08;
    letter-spacing: -.03em;
    margin: 16px 0 8px;
    font-weight: 800;
    background: linear-gradient(135deg, #2b1b1b 30%, var(--brand-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

[data-theme="dark"] .hero-copy h1 {
    background: linear-gradient(135deg, #fff 30%, #f59a9a);
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-copy h2 {
    font-size: clamp(1.05rem, 2vw, 1.4rem);
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--brand);
}

.hero-copy p {
    margin-top: 18px;
    font-size: .95rem;
    line-height: 1.65;
    color: var(--muted);
    max-width: 420px;
}

.hero-copy .rule {
    width: 96px;
    height: 2px;
    margin-top: 28px;
    background: linear-gradient(90deg, var(--brand), transparent);
}

.login-card {
    width: 100%;
    max-width: 410px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid color-mix(in srgb, var(--border) 70%, #fff);
    border-radius: 22px;
    padding: 66px 32px 26px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: rise .6s .08s ease both;
}

.login-card::before {
    content: '';
    position: absolute;
    left: 28px;
    right: 28px;
    top: 0;
    height: 3px;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
}

.logo-badge {
    position: absolute;
    top: -46px;
    left: 50%;
    transform: translateX(-50%);
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: var(--surface);
    border: 3px solid var(--red-200);
    display: grid;
    place-items: center;
    box-shadow: 0 10px 26px rgba(217, 58, 58, .22);
    overflow: hidden;
}

.logo-badge .logo-in {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #f26767, #d93a3a);
    color: #fff;
    font-weight: 800;
    font-size: 1.45rem;
    letter-spacing: .02em;
}

.logo-badge img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.secure {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--brand-dark);
    background: var(--red-50);
    border: 1px solid var(--red-200);
    padding: 4px 10px;
    border-radius: 999px;
}

[data-theme="dark"] .secure {
    background: #3a2327;
    border-color: #5a3a3f;
}

.secure .i {
    width: 12px;
    height: 12px;
}

.login-card h3 {
    text-align: center;
    letter-spacing: .18em;
    font-size: 1rem;
    font-weight: 700;
}

.login-card .sub {
    text-align: center;
    color: var(--muted);
    font-size: .84rem;
    margin: 8px 0 24px;
}

.field {
    margin-bottom: 16px;
}

.field-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.field label {
    font-weight: 600;
    font-size: .8rem;
}

.field .forgot {
    font-size: .76rem;
    color: var(--brand-dark);
    font-weight: 500;
}

.field .forgot:hover {
    text-decoration: underline;
}

.input-wrap {
    position: relative;
    margin-top: 7px;
}

.input-wrap>.i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #c98b8b;
    transition: color .15s;
}

.input-wrap:focus-within>.i {
    color: var(--brand);
}

.input-wrap input {
    width: 100%;
    height: 46px;
    padding: 0 44px;
    border-radius: 12px;
    font: inherit;
    font-size: .88rem;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--border);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.input-wrap input::placeholder {
    color: #b9a0a0;
}

.input-wrap input:hover {
    border-color: #e9b9b9;
}

.input-wrap input:focus {
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(239, 83, 80, .16);
}

.input-wrap .toggle-pw {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: #c98b8b;
    display: grid;
    place-items: center;
    border-radius: 8px;
}

.input-wrap .toggle-pw:hover {
    color: var(--brand-dark);
    background: var(--red-50);
}

.error {
    color: #b91c1c;
    font-size: .78rem;
    margin-top: 6px;
}

[data-theme="dark"] .error {
    color: #fca5a5;
}

.btn-primary {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 46px;
    margin-top: 6px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: linear-gradient(135deg, #f26767, #dc3a3a);
    box-shadow: 0 10px 20px -6px rgba(220, 58, 58, .5);
    transition: transform .15s, box-shadow .15s, filter .15s;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .6s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -6px rgba(220, 58, 58, .55);
}

.btn-primary:hover::after {
    transform: translateX(120%);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:focus-visible {
    outline: 3px solid rgba(239, 83, 80, .4);
    outline-offset: 2px;
}

.btn-primary[disabled] {
    opacity: .8;
    cursor: progress;
}

.connected {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.connected .title {
    font-size: .62rem;
    letter-spacing: .22em;
    font-weight: 600;
    color: var(--muted);
}

.chips {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.chip {
    width: 72px;
    text-align: center;
    font-size: .68rem;
    line-height: 1.25;
    font-weight: 500;
    color: var(--muted);
    transition: transform .15s, color .15s;
}

.chip:hover {
    transform: translateY(-3px);
    color: var(--text);
}

.chip .box {
    width: 50px;
    height: 50px;
    margin: 0 auto 7px;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(217, 58, 58, .07);
    transition: border-color .15s, box-shadow .15s;
}

.chip:hover .box {
    border-color: var(--red-300);
    box-shadow: 0 8px 16px rgba(217, 58, 58, .16);
}

.chip img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.page-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(220, 63, 63, .16);
    background: rgba(255, 255, 255, .4);
    backdrop-filter: blur(6px);
}

[data-theme="dark"] .page-footer {
    background: rgba(0, 0, 0, .2);
}

.page-footer .wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 32px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: .78rem;
    color: var(--muted);
}

.page-footer .links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.page-footer a:hover {
    color: var(--brand-dark);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ───────────── Dashboard ───────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    color: #fff;
    background: linear-gradient(90deg, var(--header-from), var(--header-to));
    box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
}

.topbar .wrap {
    max-width: 1180px;
    margin: 0 auto;
    height: 62px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
}

.brand .mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .22);
    display: grid;
    place-items: center;
    font-size: .85rem;
    font-weight: 800;
    overflow: hidden;
}

.brand .mark img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.search {
    flex: 1;
    max-width: 560px;
    position: relative;
    margin: 0 auto;
}

.search>.i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #b98a8a;
}

.search input {
    width: 100%;
    height: 40px;
    border: 0;
    border-radius: 12px;
    padding: 0 60px 0 40px;
    font: inherit;
    font-size: .85rem;
    outline: none;
    background: #fff;
    color: #2b1b1b;
}

[data-theme="dark"] .search input {
    background: #34222a;
    color: #fbeaea;
}

.search kbd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .66rem;
    color: #8b6a6a;
    background: #f7e3e3;
    border-radius: 6px;
    padding: 2px 6px;
    font-family: inherit;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, .2);
    display: grid;
    place-items: center;
    transition: .15s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, .32);
}

.profile {
    position: relative;
}

.profile>button {
    height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .85rem;
    font-weight: 600;
}

.profile>button:hover {
    background: rgba(255, 255, 255, .32);
}

.menu {
    position: absolute;
    right: 0;
    top: 50px;
    min-width: 210px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 6px;
    font-size: .85rem;
    display: none;
}

.menu.open {
    display: block;
}

.menu .who {
    padding: 9px 11px;
    font-size: .76rem;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 5px;
}

.menu .who b {
    display: block;
    color: var(--text);
    font-size: .86rem;
}

.menu button {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 9px 11px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.menu button:hover {
    background: var(--red-50);
}

[data-theme="dark"] .menu button:hover {
    background: #3a2327;
}

.hero {
    background: linear-gradient(180deg, var(--surface), var(--bg));
    border-bottom: 1px solid var(--border);
}

.hero .wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 38px 24px 42px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.hero .kicker {
    font-size: .72rem;
    letter-spacing: .12em;
    font-weight: 600;
    color: var(--brand-dark);
    text-transform: uppercase;
}

.hero h1 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: -.02em;
    margin-top: 6px;
    font-weight: 700;
}

.hero h1 span {
    color: var(--brand);
}

.hero .last {
    margin-top: 6px;
    color: var(--muted);
    font-size: .82rem;
}

.hero .bar {
    width: 72px;
    height: 3px;
    background: var(--brand);
    margin: 14px 0;
    border-radius: 2px;
}

.hero p {
    color: var(--muted);
    font-size: .9rem;
}

.hero svg.art {
    width: 200px;
    height: auto;
    flex-shrink: 0;
}

.statusbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.statusbar .wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 11px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    align-items: center;
    font-size: .8rem;
}

.statusbar .label {
    color: var(--muted);
}

.status-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-left: auto;
}

.status-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.status-item em {
    color: var(--border);
    font-style: normal;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot.ok {
    background: var(--ok);
}

.dot.warn {
    background: var(--warn);
}

.dot.brand {
    background: var(--brand);
}

.ok-text {
    color: var(--ok);
}

.warn-text {
    color: var(--warn);
}

.cards {
    max-width: 1180px;
    margin: 30px auto 44px;
    padding: 0 24px;
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 330px;
    padding: 16px 18px 18px;
    background: var(--surface);
    border-radius: 14px;
    border-top: 3px solid var(--accent, var(--brand));
    box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
    transition: transform .18s, box-shadow .18s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge.ok {
    color: #15803d;
    background: #effcf3;
    border-color: #bbf0cc;
}

.badge.warn {
    color: #b45309;
    background: #fff7e6;
    border-color: #fadf9d;
}

.badge.off {
    color: #b91c1c;
    background: #fff0f0;
    border-color: #fbcaca;
}

.badge.primary {
    color: #fff;
    background: #7f1d1d;
    border-color: #7f1d1d;
}

.badge.primary::before {
    display: none;
}

.logo-circle {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    margin: 22px auto 16px;
    display: grid;
    place-items: center;
    font-size: 2.7rem;
    background: var(--red-50);
    background: color-mix(in srgb, var(--accent, #ef4444) 12%, var(--surface));
}

.logo-circle img {
    width: 66px;
    height: 66px;
    object-fit: contain;
}

.card h3 {
    text-align: center;
    color: var(--accent, var(--brand-dark));
    font-size: 1.02rem;
    font-weight: 700;
}

.summary {
    text-align: center;
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.5;
    margin-top: 8px;
    opacity: 0;
    transition: opacity .2s;
}

.card:hover .summary,
.card:focus-visible .summary {
    opacity: 1;
}

@media (hover: none) {
    .summary {
        opacity: 1;
    }
}

.card-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: .84rem;
}

.go {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--accent, var(--brand));
    border: 1px solid var(--border);
    background: var(--surface);
    transition: .15s;
}

.card:hover .go {
    background: var(--accent, var(--brand));
    color: #fff;
    border-color: transparent;
}

.card.is-blocked {
    border-top-style: solid;
    border-left: 1px dashed var(--border);
    border-right: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
    background: var(--bg);
    cursor: not-allowed;
}

.card.is-blocked:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
}

.card.is-blocked .logo-circle {
    filter: grayscale(.4);
    opacity: .85;
}

.no-results {
    display: none;
    max-width: 1180px;
    margin: 0 auto 40px;
    padding: 0 24px;
    text-align: center;
    color: var(--muted);
}

.site-footer {
    color: #fff;
    background: linear-gradient(90deg, var(--header-from), var(--header-to));
}

.site-footer .wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: .8rem;
}

.site-footer .links {
    display: flex;
    gap: 20px;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* launch (handoff) page */
.launch {
    min-height: 100vh;
    display: grid;
    place-items: center;
    text-align: center;
    background: linear-gradient(135deg, #fff3f3, #ffd9d9);
    color: var(--text);
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 4px solid var(--red-200);
    border-top-color: var(--brand);
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .login-main {
        flex-direction: column;
        padding-top: 84px;
        text-align: center;
    }

    .hero-copy .eyebrow {
        justify-content: center;
    }

    .hero-copy p,
    .hero-copy .rule {
        margin-left: auto;
        margin-right: auto;
    }

    .ring {
        left: 50%;
    }

    .hero svg.art {
        display: none;
    }

    .search {
        display: none;
    }

    .status-items {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    .hero-copy,
    .login-card {
        animation: none;
    }

    * {
        transition: none !important;
    }
}