:root {
    --qo-bg: #fafafa;
    --qo-bg-alt: #f4f4f3;
    --qo-surface: #ffffff;
    --qo-border: #ececec;
    --qo-border-strong: #dcdcdc;
    --qo-text: #0e0e0e;
    --qo-text-2: #646464;
    --qo-text-3: #9a9a9a;
    --qo-accent: #5b5bd6;
    --qo-accent-soft: #eeeefb;
    --qo-accent-ink: #ffffff;
    --qo-accent-hover: #4848c6;
    --qo-accent-active: #3a3aab;
    --qo-green: #3a8c5f;
    --qo-green-soft: #ecf5ef;
    --qo-red: #c4413a;
    --qo-red-soft: #fbecec;
    --qo-font: 'Inter', system-ui, -apple-system, sans-serif;
    --qo-mono: 'JetBrains Mono', ui-monospace, monospace;
    --qo-r-2: 3px;
    --qo-r-6: 6px;
    --qo-r-8: 8px;
    --qo-h-lg: 32px;
    --qo-h-xl: 36px;
    --qo-shadow-popover: 0 1px 1px rgba(0, 0, 0, .04), 0 4px 12px rgba(0, 0, 0, .06);
}

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

html,
body {
    margin: 0;
    height: 100%;
}

body {
    display: flex;
    min-height: 100vh;
    font-family: var(--qo-font);
    color: var(--qo-text);
    background: var(--qo-bg);
}

/* ── Brand panel ── */
.auth-brand {
    flex: 0 0 42%;
    background: var(--qo-accent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #fff;
}

.auth-brand-content {
    text-align: center;
}

.auth-brand-logo {
    max-height: 60px;
    max-width: 160px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 1.25rem;
}

.auth-brand-icon {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    opacity: .85;
}

.auth-brand-name {
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -.3px;
    margin-bottom: .3rem;
}

.auth-brand-sub {
    font-family: var(--qo-mono);
    font-size: 10.5px;
    letter-spacing: .5px;
    text-transform: uppercase;
    opacity: .6;
    margin-bottom: 2.5rem;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .65rem;
    font-size: 12.5px;
    opacity: .8;
}

.auth-features li i {
    font-size: 14px;
    flex-shrink: 0;
}

/* ── Form panel ── */
.auth-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--qo-bg);
}

.auth-form-card {
    width: 100%;
    max-width: 380px;
}

.auth-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -.3px;
    margin-bottom: .25rem;
}

.auth-subtitle {
    font-size: 12px;
    color: var(--qo-text-3);
    margin-bottom: 1.75rem;
}

/* ── Fields ── */
.form-field {
    margin-bottom: 14px;
}

.qo-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--qo-text);
    display: block;
    margin-bottom: 4px;
}

.qo-input {
    width: 100%;
    height: var(--qo-h-lg);
    padding: 0 10px;
    font-size: 13px;
    font-family: var(--qo-font);
    color: var(--qo-text);
    background: var(--qo-surface);
    border: 1px solid var(--qo-border);
    border-radius: var(--qo-r-6);
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}

.qo-input::placeholder {
    color: var(--qo-text-3);
}

.qo-input:focus {
    border-color: var(--qo-accent);
    box-shadow: 0 0 0 3px var(--qo-accent-soft);
}

/* ── Checkbox ── */
.qo-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--qo-text-2);
    cursor: pointer;
    user-select: none;
}

.qo-check input[type="checkbox"] {
    width: 14px;
    height: 14px;
    border-radius: var(--qo-r-2);
    accent-color: var(--qo-accent);
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Button ── */
.qo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--qo-font);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--qo-r-6);
    background: transparent;
    color: var(--qo-text);
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    transition: background .12s, border-color .12s;
    text-decoration: none;
}

.qo-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--qo-accent-soft);
}

.qo-btn--primary {
    background: var(--qo-accent);
    color: var(--qo-accent-ink);
    border-color: var(--qo-accent);
}

.qo-btn--primary:hover {
    background: var(--qo-accent-hover);
    border-color: var(--qo-accent-hover);
}

.qo-btn--primary:active {
    background: var(--qo-accent-active);
    border-color: var(--qo-accent-active);
}

.qo-btn--xl {
    height: var(--qo-h-xl);
    padding: 0 16px;
}

.qo-btn--full {
    width: 100%;
}

/* ── Divider + footer ── */
.auth-sep {
    border: none;
    border-top: 1px solid var(--qo-border);
    margin: 20px 0;
}

.auth-footer {
    text-align: center;
    font-size: 12px;
    color: var(--qo-text-3);
}

.auth-footer a {
    color: var(--qo-accent);
    text-decoration: none;
    font-weight: 500;
}

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

.auth-copy {
    text-align: center;
    font-family: var(--qo-mono);
    font-size: 11px;
    color: var(--qo-text-3);
    margin-top: 20px;
}

/* ── QO Toasts ── */
.qo-toasts {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}

.qo-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 340px;
    background: var(--qo-surface);
    border: 1px solid var(--qo-border);
    border-radius: var(--qo-r-8);
    box-shadow: var(--qo-shadow-popover);
    padding: 12px 14px;
    position: relative;
    overflow: hidden;
    pointer-events: all;
    animation: qo-toast-in .18s ease;
}

@keyframes qo-toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.qo-toast__bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.qo-toast__icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.qo-toast__body {
    flex: 1;
}

.qo-toast__title {
    font-size: 13px;
    font-weight: 500;
    color: var(--qo-text);
}

.qo-toast__close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--qo-text-3);
    font-size: 16px;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.qo-toast--error .qo-toast__bar {
    background: var(--qo-red);
}

.qo-toast--error .qo-toast__icon {
    color: var(--qo-red);
}

.qo-toast--success .qo-toast__bar {
    background: var(--qo-green);
}

.qo-toast--success .qo-toast__icon {
    color: var(--qo-green);
}

/* ── Responsive ── */
/* ── Two-factor ── */
.two-factor-qr {
    display: flex;
    justify-content: center;
    padding: 12px;
    margin-bottom: 14px;
    background: var(--qo-surface);
    border: 1px solid var(--qo-border);
    border-radius: var(--qo-r-8);
}

.two-factor-qr img {
    width: 180px;
    height: 180px;
}

.two-factor-secret {
    padding: 8px 10px;
    font-family: var(--qo-mono);
    font-size: 13px;
    letter-spacing: .04em;
    text-align: center;
    word-break: break-all;
    background: var(--qo-bg-alt);
    border: 1px solid var(--qo-border);
    border-radius: var(--qo-r-6);
    user-select: all;
}

.two-factor-code {
    font-family: var(--qo-mono);
    font-size: 18px;
    letter-spacing: .5em;
    text-align: center;
}

.two-factor-back {
    display: block;
    margin-top: 14px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    color: var(--qo-accent);
    text-decoration: none;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .auth-brand {
        flex: 0 0 auto;
        padding: 2rem 1.5rem;
    }

    .auth-brand-sub {
        margin-bottom: 0;
    }

    .auth-features {
        display: none;
    }

    .auth-form-panel {
        padding: 2rem 1.5rem;
        justify-content: flex-start;
        padding-top: 2.5rem;
    }
}
