/* =============================================================================
 * admin-login.css — standalone admin login page styles.
 * Extracted VERBATIM from the inline <style> in admin/login, which is a full-page
 * standalone template (<!DOCTYPE html>, does NOT extend admin/layout → does NOT
 * load the shared admin.css). Linked in login's <head> with a filemtime
 * cache-buster. Tokens are page-local (--rb-*); resets/body styles are intended
 * to be page-global on the login document only.
 * ========================================================================== */
*,*::before,*::after { box-sizing: border-box; }

:root {
    --rb-bg: #0a0908;
    --rb-surface: #121110;
    --rb-elevated: #1a1917;
    --rb-border: rgba(245, 244, 242, 0.06);
    --rb-border-strong: rgba(245, 244, 242, 0.12);
    --rb-text: #f5f4f2;
    --rb-text-dim: #8a8680;
    --rb-text-faint: #57544f;
    --rb-accent: #ff5722;
    --rb-accent-glow: rgba(255, 87, 34, 0.35);
    --rb-danger: #ef4444;
    --rb-input-bg: #0d0c0b;
}

/* Light theme — mirrors the admin shell (data-theme="light" set from
   the admin-theme localStorage key by the inline head script). Without
   these overrides the login renders dark-on-dark while the rest of the
   admin panel is light. */
:root[data-theme="light"] {
    --rb-bg: #f4f2f0;
    --rb-surface: #ffffff;
    --rb-elevated: #faf9f8;
    --rb-border: rgba(20, 18, 16, 0.10);
    --rb-border-strong: rgba(20, 18, 16, 0.18);
    --rb-text: #1a1815;
    --rb-text-dim: #6b6760;
    --rb-text-faint: #9a958d;
    --rb-accent: #ff5722;
    --rb-accent-glow: rgba(255, 87, 34, 0.25);
    --rb-danger: #dc2626;
    --rb-input-bg: #ffffff;
}

:root[data-theme="light"] body::before {
    background-image:
        linear-gradient(rgba(20, 18, 16, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 18, 16, 0.035) 1px, transparent 1px);
}

:root[data-theme="light"] .rb-alert--err {
    background: rgba(220, 38, 38, 0.07);
    border-color: rgba(220, 38, 38, 0.25);
    color: #b91c1c;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--rb-bg);
    color: var(--rb-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-feature-settings: 'cv11', 'ss01';
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Grid backdrop */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(245, 244, 242, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245, 244, 242, 0.015) 1px, transparent 1px);
    background-size: 48px 48px;
}

/* Ember corner glow */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 40% at 0% 100%, rgba(255, 87, 34, 0.08), transparent 70%),
        radial-gradient(ellipse 40% 30% at 100% 0%, rgba(255, 87, 34, 0.04), transparent 70%);
}

.rb-wrap {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

/* Brand header */
.rb-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0 0.25rem;
}

.rb-brand__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.rb-brand__wordmark {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--rb-text);
    letter-spacing: -0.02em;
}

.rb-brand__meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--rb-text-faint);
    letter-spacing: 0.05em;
}

/* Panel */
.rb-panel {
    background: var(--rb-surface);
    border: 1px solid var(--rb-border);
    border-radius: 10px;
    padding: 2rem;
    position: relative;
}

/* Corner tick marks */
.rb-panel::before,
.rb-panel::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 1.5px solid var(--rb-accent);
}

.rb-panel::before {
    top: -1px;
    left: -1px;
    border-right: none;
    border-bottom: none;
}

.rb-panel::after {
    bottom: -1px;
    right: -1px;
    border-left: none;
    border-top: none;
}

.rb-panel__head {
    margin-bottom: 1.5rem;
    text-align: center;
}

.rb-eyebrow {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--rb-accent);
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}

.rb-h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--rb-text);
    margin: 0 0 0.4rem;
    letter-spacing: -0.025em;
}

.rb-lead {
    font-size: 0.85rem;
    color: var(--rb-text-dim);
    margin: 0;
    line-height: 1.5;
}

/* Form */
.rb-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rb-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rb-field__label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rb-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--rb-text-dim);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.rb-forgot {
    font-size: 0.7rem;
    color: var(--rb-accent);
    text-decoration: none;
    font-weight: 500;
}

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

.rb-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--rb-input-bg);
    border: 1px solid var(--rb-border);
    border-radius: 6px;
    color: var(--rb-text);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.rb-input:focus {
    outline: none;
    border-color: var(--rb-accent);
    background: var(--rb-elevated);
    box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.1);
}

.rb-input::placeholder {
    color: var(--rb-text-faint);
}

.rb-remember {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    user-select: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--rb-text-dim);
}

.rb-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border: 1.5px solid var(--rb-border-strong);
    border-radius: 3px;
    background: var(--rb-input-bg);
    cursor: pointer;
    position: relative;
    transition: all 120ms ease;
    flex-shrink: 0;
}

.rb-checkbox:checked {
    background: var(--rb-accent);
    border-color: var(--rb-accent);
}

.rb-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 4px;
    height: 8px;
    border: solid #0a0908;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Primary button */
.rb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.2rem;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: -0.005em;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 120ms ease, box-shadow 120ms ease, transform 80ms ease;
    width: 100%;
}

.rb-btn:active {
    transform: translateY(1px);
}

.rb-btn--primary {
    background: var(--rb-accent);
    color: #0a0908;
    box-shadow: 0 0 0 1px rgba(255, 87, 34, 0.3);
}

.rb-btn--primary:hover {
    background: #ff6b3d;
    box-shadow: 0 0 24px -8px var(--rb-accent-glow);
}

.rb-btn__arrow {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    transition: transform 120ms ease;
}

.rb-btn:hover .rb-btn__arrow {
    transform: translateX(3px);
}

/* Alert */
.rb-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

.rb-alert--err {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.rb-alert__bar {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--rb-danger);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Security notes */
.rb-security {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rb-border);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.rb-security__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--rb-text-faint);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
}

.rb-security__dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--rb-accent);
    opacity: 0.6;
    flex-shrink: 0;
}

/* Footer */
.rb-foot {
    margin-top: 1.5rem;
    padding: 0 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--rb-text-faint);
}

.rb-foot a {
    color: var(--rb-text-faint);
    text-decoration: none;
    transition: color 120ms ease;
}

.rb-foot a:hover {
    color: var(--rb-accent);
}
