@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&family=Roboto+Slab:wght@700&display=swap');

:root {
    --bbe-bg: #0a0a0a;
    --bbe-accent: #00e5ff;
    --bbe-accent-hover: #66eeff;
    --bbe-accent-glow: rgba(0, 229, 255, 0.22);
    --bbe-text: #f5f5f5;
    --bbe-text-muted: #a3a3a3;
    --bbe-text-dim: #737373;
    --bbe-border: rgba(255, 255, 255, 0.1);
    --bbe-card: #161616;
    --bbe-ink: #0a0a0a;
}

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

html, body {
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: var(--bbe-bg);
    color: var(--bbe-text);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(0, 229, 255, 0.05) 0%, transparent 55%),
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: auto, 26px 26px, 26px 26px;
    pointer-events: none;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    position: relative;
}

.auth-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
    max-width: 960px;
    position: relative;
    z-index: 1;
    align-items: start;
}

.auth-main {
    width: 100%;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 28px;
    text-decoration: none;
    color: var(--bbe-text);
}

.auth-logo .bbe-logo-b-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bbe-accent);
    color: #0a0a0a;
    font-family: 'Roboto Slab', Georgia, serif;
    font-weight: 700;
    line-height: 1;
    border-radius: 5px;
    width: 24px;
    height: 24px;
    font-size: 15px;
}

.auth-logo .bbe-logo-text {
    font-family: 'Roboto Slab', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.auth-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
}

.auth-tab {
    padding: 8px 20px;
    border-radius: 999px;
    border: 1px solid var(--bbe-border);
    background: transparent;
    color: var(--bbe-text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active,
.auth-tab:hover {
    background: var(--bbe-accent);
    color: #0a0a0a;
    border-color: var(--bbe-accent);
}

.auth-panels { position: relative; }

.auth-panel {
    display: none;
    background: var(--bbe-card);
    border: 1px solid var(--bbe-border);
    border-radius: 12px;
    padding: 32px;
}

.auth-panel.active { display: block; }

.auth-panel.auth-panel-active {
    display: block;
    background: var(--bbe-card);
    border: 1px solid var(--bbe-border);
    border-radius: 12px;
    padding: 32px;
}

.auth-panel[hidden] {
    display: none !important;
}

.auth-step-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 229, 255, 0.12);
    color: var(--bbe-accent);
    border: 1px solid rgba(0, 229, 255, 0.18);
}

.auth-step-icon svg {
    width: 24px;
    height: 24px;
}

.auth-panel h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.auth-panel p.subtitle {
    color: var(--bbe-text-muted);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.auth-panel .form-control,
.auth-panel .form-select {
    width: 100%;
    background: var(--bbe-bg);
    border: 1px solid var(--bbe-border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--bbe-text);
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.auth-panel .form-control:focus,
.auth-panel .form-select:focus {
    outline: none;
    border-color: var(--bbe-accent);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}

.auth-panel button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--bbe-accent);
    color: #0a0a0a;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.auth-panel button[type="submit"]:hover {
    background: var(--bbe-accent-hover);
    box-shadow: 0 0 20px var(--bbe-accent-glow);
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    color: var(--bbe-text-muted);
    font-size: 0.85rem;
}

.auth-switch a {
    color: var(--bbe-accent);
    font-weight: 600;
    cursor: pointer;
}

.auth-alert {
    max-width: 960px;
    width: 100%;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

.auth-alert-danger {
    background: rgba(220, 53, 69, 0.12);
    border: 1px solid rgba(220, 53, 69, 0.35);
    color: #ff6b6b;
}

.auth-alert-success {
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: #99f6ff;
}

.auth-back {
    margin-top: 20px;
}

.auth-back a {
    color: var(--bbe-text-muted);
    font-size: 0.85rem;
    text-decoration: none;
}

.auth-back a:hover { color: var(--bbe-accent); }

/* Right visual — same as home bbe-intro image (no frame, contain) */
.auth-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.auth-visual-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.auth-visual-img {
    width: 100%;
    max-width: min(100%, 340px);
    height: auto;
    display: block;
    object-fit: contain;
    object-position: center;
}

.auth-visual-caption {
    margin-top: 20px;
    text-align: center;
    max-width: 320px;
}

.auth-visual-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bbe-text);
    margin-bottom: 6px;
}

.auth-visual-desc {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--bbe-text-muted);
}

@media (min-width: 768px) {
    .auth-shell {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
        align-items: center;
    }

    .auth-visual {
        position: sticky;
        top: 24px;
    }

    .auth-visual-img {
        max-width: 320px;
    }
}

@media (max-width: 767px) {
    .auth-panel { padding: 24px 18px; }
}

@media (max-width: 576px) {
    .auth-page { padding: 16px; }
    .auth-panel { padding: 22px 16px; }
}

.auth-inline-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(220, 53, 69, 0.12);
    border: 1px solid rgba(220, 53, 69, 0.35);
    color: #ff6b6b;
    font-size: 0.85rem;
    line-height: 1.45;
}

.auth-legal-note {
    margin: 0 0 14px;
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.55);
}

.auth-legal-note a {
    color: #99f6ff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-legal-note a:hover {
    color: #fff;
}

.auth-inline-success {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: #99f6ff;
    font-size: 0.85rem;
    line-height: 1.45;
}

body.auth-otp-open {
    overflow: hidden;
}

.auth-otp-modal[hidden] {
    display: none !important;
}

.auth-otp-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-otp-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 4, 4, 0.82);
    backdrop-filter: blur(4px);
}

.auth-otp-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    background: var(--bbe-card);
    border: 1px solid var(--bbe-border);
    border-radius: 20px;
    padding: 32px 28px 28px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    text-align: center;
}

.auth-otp-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 229, 255, 0.12);
    color: var(--bbe-accent);
    border: 1px solid rgba(0, 229, 255, 0.18);
}

.auth-otp-icon svg {
    width: 26px;
    height: 26px;
}

.auth-otp-dialog h2 {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--bbe-text);
    letter-spacing: -0.01em;
}

.auth-otp-subtitle {
    margin: 0 0 24px;
    color: var(--bbe-text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.auth-otp-subtitle strong {
    color: var(--bbe-text);
    font-weight: 600;
}

.auth-otp-digits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}

.auth-otp-digit {
    width: 46px;
    height: 52px;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    background: var(--bbe-bg);
    color: var(--bbe-text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    padding: 0;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    caret-color: var(--bbe-accent);
}

.auth-otp-digit::placeholder {
    color: var(--bbe-text-dim);
    opacity: 0.7;
    font-size: 1.5rem;
    line-height: 1;
}

.auth-otp-digit:focus {
    border-color: var(--bbe-accent);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.14);
    background: rgba(0, 229, 255, 0.04);
}

.auth-otp-digit:not(:placeholder-shown) {
    border-color: rgba(0, 229, 255, 0.35);
}

.auth-otp-message {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.84rem;
    line-height: 1.45;
    text-align: center;
}

.auth-otp-message[hidden] {
    display: none !important;
}

.auth-otp-message-error {
    background: rgba(220, 53, 69, 0.12);
    border: 1px solid rgba(220, 53, 69, 0.35);
    color: #ff6b6b;
}

.auth-otp-message-success {
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: #99f6ff;
}

.auth-otp-resend {
    margin: 0 0 18px;
    text-align: center;
    color: var(--bbe-text-muted);
    font-size: 0.88rem;
}

.auth-otp-resend button {
    background: none;
    border: none;
    color: var(--bbe-accent);
    cursor: pointer;
    padding: 0;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-otp-resend button:hover {
    color: var(--bbe-accent-hover);
}

.auth-otp-resend button:disabled {
    opacity: 0.5;
    cursor: wait;
}

.auth-otp-submit {
    width: 100%;
    padding: 13px 16px;
    background: var(--bbe-accent);
    color: #0a0a0a;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-otp-submit:hover:not(:disabled) {
    background: var(--bbe-accent-hover);
    box-shadow: 0 0 24px var(--bbe-accent-glow);
}

.auth-otp-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.auth-secondary-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--bbe-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--bbe-border);
    border-radius: 8px;
    cursor: pointer;
}

.auth-secondary-btn:hover {
    border-color: var(--bbe-accent);
    color: var(--bbe-text);
}

.mt-3 { margin-top: 14px; }

@media (max-width: 420px) {
    .auth-otp-dialog {
        padding: 28px 20px 24px;
    }

    .auth-otp-digits {
        gap: 8px;
    }

    .auth-otp-digit {
        width: 42px;
        height: 48px;
        font-size: 1.2rem;
        border-radius: 10px;
    }
}

.auth-card {
    width: 100%;
    max-width: 520px;
    background: var(--bbe-card);
    border: 1px solid var(--bbe-border);
    border-radius: 16px;
    padding: 28px 24px;
}

.auth-card-head h1 {
    margin: 0 0 8px;
    font-size: 1.5rem;
}

.auth-card-head p {
    margin: 0 0 20px;
    color: var(--bbe-text-muted);
}

.auth-banned-reason {
    margin: 8px 0 0;
    color: var(--bbe-text);
    line-height: 1.6;
    white-space: pre-line;
}

.auth-banned-help {
    margin: 0 0 20px;
    color: var(--bbe-text-dim);
    font-size: 0.88rem;
    line-height: 1.55;
}

.auth-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.auth-btn-primary {
    background: var(--bbe-accent);
    color: #080612 !important;
}

.auth-btn-primary:hover {
    background: var(--bbe-accent-hover);
    box-shadow: 0 0 24px var(--bbe-accent-glow);
}

.auth-btn-secondary {
    background: transparent;
    border-color: var(--bbe-border);
    color: var(--bbe-text) !important;
}

.auth-btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.18);
}
