@font-face {
    font-family: "Geist";
    src: url("/_demo/fonts/Geist-VariableFont_wght.ttf") format("truetype-variations");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Chrobyte brand tokens: #1967AB / #5ECAE7 / #90ADB9, surface #F0F4F7, ink #161616 */
:root {
    --bg: #f0f4f7;
    --bg-elev: #ffffff;
    --ink: #161616;
    --ink-soft: #4d5b68;
    --ink-dim: #90adb9;
    --rule: #dbe4ea;
    --rule-strong: #bccbd5;
    --brand: #1967ab;
    --brand-hover: #14528a;
    --brand-soft: #5ecae7;
    --brand-tint: #e8f1f9;
    --gradient: linear-gradient(90deg, #1967ab 0%, #5ecae7 100%);
    --danger: #c00d49;
    --shadow: 0 1px 0 rgba(22, 22, 22, .04), 0 24px 60px -36px rgba(25, 103, 171, .35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
    outline: 2px solid var(--brand-soft);
    outline-offset: 2px;
}

/* Brand signature: the gradient hairline from letterhead and business card, and the wordmark. */
.cb-rule {
    display: block;
    height: 2px;
    border: 0;
    margin: 0;
    background: var(--gradient);
    border-radius: 1px;
}

.cb-wordmark {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.brand-mark {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.3rem;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

    .btn:hover {
        background: var(--brand-hover);
    }

.btn-ghost {
    background: transparent;
    color: var(--brand);
    border: 1px solid var(--rule-strong);
}

    .btn-ghost:hover {
        background: var(--brand-tint);
        border-color: var(--brand);
    }

.note {
    font-size: 0.8rem;
    color: var(--ink-soft);
    text-align: center;
}

.error {
    color: var(--danger);
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

/* Login / message pages */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.card {
    background: var(--bg-elev);
    border: 1px solid var(--rule);
    border-radius: 16px;
    padding: 2rem 2.25rem 2.25rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

    .card h1 {
        margin: 1.5rem 0 0.25rem;
        font-size: 1.35rem;
        font-weight: 600;
        letter-spacing: -0.02em;
        color: var(--ink);
    }

    .card .subtitle {
        margin: 0 0 1.5rem;
        font-size: 0.92rem;
        color: var(--ink-soft);
    }

    .card label {
        display: block;
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--ink-soft);
        margin-bottom: 0.35rem;
    }

    .card input[type="password"] {
        width: 100%;
        padding: 0.65rem 0.75rem;
        border: 1px solid var(--rule-strong);
        border-radius: 8px;
        font-family: inherit;
        font-size: 1rem;
        background: var(--bg);
        margin-bottom: 1.25rem;
    }

        .card input[type="password"]:focus {
            outline: none;
            border-color: var(--brand);
            background: var(--bg-elev);
            box-shadow: 0 0 0 3px rgba(94, 202, 231, 0.35);
        }

    .card .btn {
        width: 100%;
    }

    .card .note {
        margin: 1.25rem 0 0;
    }

    .card .logout {
        margin-top: 1.25rem;
    }

/* Frame page */

.frame-page main {
    padding: 0.5rem 1rem 2.5rem;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1.5rem;
    background: var(--bg-elev);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .topbar-brand .brand-mark {
        width: 32px;
        height: 32px;
    }

.topbar-title {
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.topbar-customer {
    font-weight: 500;
    color: var(--ink-dim);
    margin-left: 0.4rem;
}

.logout button {
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
}

    .logout button:hover {
        color: var(--ink);
        border-color: var(--rule-strong);
    }

.mode-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 1.25rem;
}

    .mode-toggle button {
        background: transparent;
        border: none;
        border-radius: 999px;
        color: var(--ink-dim);
        cursor: pointer;
        font-family: inherit;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.1em;
        line-height: 26px;
        margin: 0 2px;
        padding: 0 12px;
        text-transform: uppercase;
        transition: 200ms background-color ease, 200ms color ease;
    }

        .mode-toggle button.is-selected {
            background: var(--ink);
            color: #fff;
        }

.device {
    padding: 2rem;
    display: flex;
    justify-content: center;
}

    .device > figure {
        border-radius: 32px;
        box-shadow: 0 0 0 14px #161616, 0 0 0 17px #9fa3a8, 0 30px 60px -20px rgba(25, 103, 171, 0.35);
        margin: auto;
        width: 360px;
        height: 720px;
        overflow: hidden;
        position: relative;
        z-index: 1;
        background: #fff;
    }

        .device > figure > iframe {
            border: none;
            height: 100%;
            left: 0;
            position: absolute;
            top: 0;
            width: 100%;
            z-index: 1;
        }

.device-bar {
    display: block;
    fill: #161616;
    opacity: 0.1;
    padding: 0.5rem 0.75rem;
    position: relative;
    width: 335px;
    z-index: 2;
}

.device-notch {
    display: none;
    fill: #161616;
    left: 50%;
    position: absolute;
    top: -1px;
    transform: translateX(-50%);
    width: 165px;
    z-index: 2;
}

.device.ios figure::after {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    bottom: 6px;
    content: "";
    height: 4px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 35%;
    z-index: 2;
}

.device.ios .device-notch {
    display: block;
}

.device.md figure {
    border-radius: 20px;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.version {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

    .version select {
        padding: 0.5rem 0.7rem;
        border: 1px solid var(--rule-strong);
        border-radius: 8px;
        font-family: inherit;
        font-size: 0.9rem;
        background: var(--bg-elev);
        color: var(--ink);
    }

.frame-page .note {
    margin-top: 1.25rem;
}

@media (max-width: 435px) {
    .device > figure {
        width: 335px;
        height: 670px;
    }
}

@media (max-width: 400px) {
    .device {
        padding: 1.5rem 1rem;
    }

    .device > figure {
        width: 300px;
        height: 600px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .mode-toggle button {
        transition: none;
    }
}
