/**
 * Regnbow Auth — split-card portal (EONSIM-style layout, Regnbow colors)
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --rb-brand: #530834;
    --rb-brand-deep: #3a0524;
    --rb-brand-light: #7a1549;
    --rb-brand-soft: #f3e8ee;
    --rb-ink: #141014;
    --rb-muted: #6b5d63;
    --rb-faint: #9a8b91;
    --rb-white: #ffffff;
    --rb-input-bg: #f4f2f3;
    --rb-border: #e6dde1;
    --rb-page-bg: #ece8ea;
    --rb-radius: 20px;
    --rb-radius-sm: 14px;
    --rb-radius-pill: 999px;
    --rb-font: 'Plus Jakarta Sans', system-ui, sans-serif;
    --rb-shadow: 0 24px 64px rgba(20, 16, 20, 0.14);
    --rb-ease: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.rb-auth {
    margin: 0;
    min-height: 100vh;
    font-family: var(--rb-font);
    color: var(--rb-ink);
    background: var(--rb-page-bg);
    -webkit-font-smoothing: antialiased;
}

.rb-auth a {
    color: var(--rb-brand);
    text-decoration: none;
    transition: color var(--rb-ease);
}

.rb-auth a:hover { color: var(--rb-brand-light); }

/* ─── Page + card shell ─── */
.rb-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.rb-auth-shell {
    display: grid;
    grid-template-columns: 0.92fr 1.08fr;
    width: 100%;
    max-width: 1040px;
    min-height: min(680px, calc(100vh - 3rem));
    background: var(--rb-white);
    border-radius: calc(var(--rb-radius) + 6px);
    overflow: hidden;
    box-shadow: var(--rb-shadow);
}

.rb-auth-shell--wide {
    max-width: 1080px;
}

@media (max-width: 900px) {
    .rb-auth-page { padding: 1rem; align-items: flex-start; }
    .rb-auth-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }
}

/* ─── Left visual panel ─── */
.rb-auth-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 2.25rem 2rem;
    background: var(--rb-brand);
    color: var(--rb-white);
    overflow: hidden;
}

.rb-auth-visual::before {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    top: -80px;
    right: -60px;
    pointer-events: none;
}

.rb-auth-visual::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    bottom: 40px;
    left: -50px;
    pointer-events: none;
}

.rb-auth-visual__content {
    position: relative;
    z-index: 1;
}

.rb-auth-visual__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rb-brand);
    background: var(--rb-white);
    border-radius: var(--rb-radius-pill);
    margin-bottom: 1.25rem;
}

.rb-auth-visual__title {
    font-size: clamp(1.65rem, 3vw, 2.1rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin: 0 0 0.75rem;
    max-width: 16ch;
}

.rb-auth-visual__text {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.88;
    margin: 0;
    max-width: 28ch;
}

.rb-auth-visual__art {
    position: relative;
    z-index: 1;
    width: min(100%, 300px);
    height: auto;
    margin: 1.5rem auto 0;
    display: block;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.15));
}

.rb-auth-visual__footer {
    position: relative;
    z-index: 1;
    margin: 1.5rem 0 0;
    font-size: 0.75rem;
    opacity: 0.55;
}

@media (max-width: 900px) {
    .rb-auth-visual {
        padding: 2rem 1.5rem 1.5rem;
        min-height: 240px;
    }
    .rb-auth-visual__art { max-height: 160px; width: auto; margin-top: 0.75rem; }
    .rb-auth-visual__footer { display: none; }
}

/* ─── Right form panel ─── */
.rb-auth-panel {
    display: flex;
    flex-direction: column;
    padding: 1.75rem 2.5rem 2.5rem;
    background: var(--rb-white);
}

@media (max-width: 600px) {
    .rb-auth-panel { padding: 1.25rem 1.25rem 2rem; }
}

.rb-auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.rb-auth-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--rb-ink) !important;
    letter-spacing: -0.02em;
}

.rb-auth-brand-link:hover { color: var(--rb-brand) !important; }

.rb-auth-brand-link__logo {
    height: 28px;
    width: auto;
}

.rb-auth-topbar__end {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rb-auth-topbar__link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--rb-ink) !important;
    background: var(--rb-input-bg);
    border-radius: var(--rb-radius-pill);
    transition: background var(--rb-ease), color var(--rb-ease);
}

.rb-auth-topbar__link:hover {
    background: var(--rb-brand-soft);
    color: var(--rb-brand) !important;
}

.rb-auth-topbar__cta {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--rb-white) !important;
    background: var(--rb-brand);
    border-radius: var(--rb-radius-pill);
    transition: background var(--rb-ease), transform var(--rb-ease);
}

.rb-auth-topbar__cta:hover {
    background: var(--rb-brand-light);
    color: var(--rb-white) !important;
    transform: translateY(-1px);
}

.rb-auth-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
}

.rb-auth-shell--wide .rb-auth-body {
    max-width: 480px;
}

.rb-auth-switch {
    text-align: center;
    font-size: 0.875rem;
    color: var(--rb-muted);
    margin: 0 0 1.25rem;
}

.rb-auth-switch a { font-weight: 700; }

.rb-auth-intro {
    text-align: center;
    margin-bottom: 1.75rem;
}

.rb-auth-heading {
    font-size: clamp(1.45rem, 2.5vw, 1.75rem);
    font-weight: 800;
    margin: 0 0 0.4rem;
    letter-spacing: -0.03em;
    color: var(--rb-ink);
    line-height: 1.2;
}

.rb-auth-heading .rb-auth-accent {
    color: var(--rb-brand);
}

.rb-auth-desc {
    font-size: 0.9rem;
    color: var(--rb-muted);
    margin: 0;
    line-height: 1.55;
}

/* ─── Form fields ─── */
.rb-auth-fields {
    display: grid;
    gap: 1rem;
}

.rb-auth-fields--2col {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 520px) {
    .rb-auth-fields--2col { grid-template-columns: 1fr; }
}

.rb-auth-field--full {
    grid-column: 1 / -1;
}

.rb-auth-field {
    margin: 0;
}

.rb-auth-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--rb-ink);
    margin-bottom: 0.45rem;
}

.rb-auth-input {
    width: 100%;
    padding: 0.85rem 1rem;
    font-family: var(--rb-font);
    font-size: 0.9rem;
    color: var(--rb-ink);
    background: var(--rb-input-bg);
    border: 1.5px solid transparent;
    border-radius: var(--rb-radius-sm);
    outline: none;
    transition: border-color var(--rb-ease), box-shadow var(--rb-ease), background var(--rb-ease);
}

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

.rb-auth-input:focus {
    background: var(--rb-white);
    border-color: var(--rb-brand);
    box-shadow: 0 0 0 3px rgba(83, 8, 52, 0.1);
}

.rb-auth-input.is-invalid {
    border-color: #c0392b;
    background: #fff8f7;
}

.rb-auth-error {
    display: block;
    font-size: 0.76rem;
    color: #c0392b;
    margin-top: 0.35rem;
    font-weight: 500;
}

.rb-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.25rem 0 0.5rem;
    flex-wrap: wrap;
}

.rb-auth-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--rb-muted);
    cursor: pointer;
    user-select: none;
    line-height: 1.45;
}

.rb-auth-check input {
    width: 16px;
    height: 16px;
    margin-top: 0.15rem;
    flex-shrink: 0;
    accent-color: var(--rb-brand);
}

.rb-auth-forgot {
    font-size: 0.82rem;
    font-weight: 600;
}

.rb-auth-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.95rem 1.5rem;
    font-family: var(--rb-font);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--rb-white);
    background: var(--rb-brand);
    border: none;
    border-radius: var(--rb-radius-pill);
    cursor: pointer;
    transition: background var(--rb-ease), transform var(--rb-ease), box-shadow var(--rb-ease);
    box-shadow: 0 8px 24px rgba(83, 8, 52, 0.28);
}

.rb-auth-submit:hover {
    background: var(--rb-brand-light);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(83, 8, 52, 0.32);
}

.rb-auth-submit:active {
    transform: translateY(0);
}

.rb-auth-alt-link {
    display: block;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rb-muted);
    margin-top: 1.25rem;
}

/* ─── Manager portal variant ─── */
.rb-auth--manager {
    --rb-brand: #2d4a35;
    --rb-brand-deep: #1a2e1f;
    --rb-brand-light: #3d5c45;
    --rb-brand-soft: #eef5f0;
}

.rb-auth--manager .rb-auth-visual {
    background: linear-gradient(160deg, var(--rb-brand-deep) 0%, var(--rb-brand) 55%, #4a7054 100%);
}

.rb-auth--manager .rb-auth-visual__badge {
    color: var(--rb-brand);
}

.rb-auth--manager .rb-auth-input:focus {
    box-shadow: 0 0 0 3px rgba(45, 74, 53, 0.12);
}

.rb-auth--manager .rb-auth-submit {
    box-shadow: 0 8px 24px rgba(45, 74, 53, 0.28);
}

.rb-auth--manager .rb-auth-submit:hover {
    box-shadow: 0 12px 28px rgba(45, 74, 53, 0.32);
}
