/* Auth pages: login, register, forgot / reset password */
:root {
    --rg-ink: #0b1220;
    --rg-ink-2: #334155;
    --rg-muted: #64748b;
    --rg-line: #e2e8f0;
    --rg-bg: #f7f9fc;
    --rg-brand: #2563eb;
    --rg-brand-2: #4f46e5;
    --rg-green: #16a34a;
    --rg-red: #dc2626;
}
body.rg-body {
    background: var(--rg-bg) !important;
    animation: none !important;
    color: var(--rg-ink) !important;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
    display: block;
}
.rg-root { width: 100%; }
.rg-body a { text-decoration: none; }

/* Flash messages */
.rg-root > .alert {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50;
    width: calc(100% - 32px); max-width: 460px; box-sizing: border-box;
    border-radius: 12px; padding: .85rem 1.1rem; font-size: .9rem; font-weight: 500;
    box-shadow: 0 12px 30px -10px rgba(15, 23, 42, .25);
    animation: rgDrop .35s ease;
}
.rg-root > .alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.rg-root > .alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.rg-root > .alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.rg-root > .alert-info, .rg-root > .alert-message { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
@keyframes rgDrop { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Layout */
.rg-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); min-height: 100vh; }

/* Left brand panel */
.rg-side {
    position: relative; overflow: hidden; color: #fff;
    background: radial-gradient(120% 120% at 0% 0%, #3b5bfd 0%, #2a3fd6 45%, #1e2a8a 100%);
    padding: 48px 56px; display: flex; flex-direction: column;
}
.rg-side::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(160deg, #000, transparent 75%);
    mask-image: linear-gradient(160deg, #000, transparent 75%);
}
.rg-side > * { position: relative; }
.rg-logo { display: inline-flex; align-items: center; gap: .65rem; color: inherit; }
.rg-logo-mark {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
    font-weight: 800; font-size: 1.15rem;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff;
}
.rg-logo-text { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; line-height: 1; }
.rg-logo-text small { display: block; font-size: .64rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; opacity: .7; margin-top: 3px; }
.rg-side-body { margin: auto 0; padding: 48px 0; max-width: 420px; }
.rg-side h1 { font-size: clamp(2rem, 3.2vw, 2.6rem); line-height: 1.12; letter-spacing: -.03em; font-weight: 800; margin: 0 0 1rem; text-wrap: balance; }
.rg-side-lead { color: rgba(255,255,255,.78); line-height: 1.7; margin: 0 0 2.2rem; font-size: 1rem; }
.rg-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.rg-steps li { display: flex; gap: .9rem; align-items: flex-start; }
.rg-step-num {
    width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%;
    display: grid; place-items: center; font-size: .82rem; font-weight: 700;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
}
.rg-steps b { display: block; font-weight: 700; margin-bottom: 2px; }
.rg-steps span { color: rgba(255,255,255,.72); font-size: .9rem; }
.rg-side-foot { color: rgba(255,255,255,.6); font-size: .82rem; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.rg-side-foot i { margin-right: .35rem; }

/* Right form panel */
.rg-main { display: flex; flex-direction: column; padding: 28px 40px; }
.rg-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.rg-top .rg-logo { color: var(--rg-ink); visibility: hidden; }
.rg-top .rg-logo-mark { background: linear-gradient(135deg, var(--rg-brand), var(--rg-brand-2)); border: 0; }
.rg-back { color: var(--rg-muted); font-size: .9rem; font-weight: 500; display: inline-flex; align-items: center; gap: .45rem; }
.rg-back:hover { color: var(--rg-brand); }
.rg-form-wrap { width: 100%; max-width: 440px; margin: auto; padding: 32px 0; }
.rg-title { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; margin: 0 0 .4rem; }
.rg-subtitle { color: var(--rg-muted); margin: 0 0 2rem; font-size: .97rem; }
.rg-subtitle a { color: var(--rg-brand); font-weight: 600; }

.rg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.rg-field { margin-bottom: 1.05rem; }
.rg-field.full { grid-column: 1 / -1; }
.rg-label { display: block; font-size: .84rem; font-weight: 600; color: var(--rg-ink-2); margin-bottom: .45rem; }
.rg-control { position: relative; }
.rg-control > i.lead { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: .88rem; pointer-events: none; transition: color .2s; }
.rg-input {
    width: 100%; box-sizing: border-box; height: 48px; padding: 0 14px 0 40px;
    border-radius: 12px; border: 1.5px solid var(--rg-line); background: #fff; color: var(--rg-ink);
    font-size: .96rem; font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}
.rg-input::placeholder { color: #a3aec2; }
.rg-input:focus { outline: none; border-color: var(--rg-brand); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.rg-control:focus-within > i.lead { color: var(--rg-brand); }
.rg-field.invalid .rg-input { border-color: #fca5a5; }
.rg-field.invalid .rg-input:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, .1); border-color: var(--rg-red); }
.rg-field.valid .rg-input { border-color: #86efac; }
.rg-hint { font-size: .78rem; color: var(--rg-muted); margin-top: .4rem; }
.rg-hint:empty { display: none; }
.rg-field.invalid .rg-hint { color: var(--rg-red); }
.rg-prefix { position: absolute; left: 40px; top: 50%; transform: translateY(-50%); color: var(--rg-ink-2); font-size: .96rem; font-weight: 500; pointer-events: none; }
.rg-input.has-prefix { padding-left: 76px; }
.rg-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; border: 0; background: none; border-radius: 9px;
    color: #94a3b8; cursor: pointer; font-size: .9rem;
}
.rg-eye:hover { background: #f1f5f9; color: var(--rg-ink-2); }
.rg-input.has-eye { padding-right: 48px; }

/* Password strength */
.rg-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: .6rem; }
.rg-meter span { height: 5px; border-radius: 99px; background: #e2e8f0; transition: background .25s; }
.rg-rules { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .78rem; color: var(--rg-muted); }
.rg-rules li { display: inline-flex; align-items: center; gap: .35rem; transition: color .2s; }
.rg-rules li i { font-size: .7rem; }
.rg-rules li.ok { color: var(--rg-green); }

.rg-submit {
    width: 100%; height: 52px; margin-top: .6rem; border: 0; border-radius: 13px; cursor: pointer;
    background: linear-gradient(135deg, var(--rg-brand), var(--rg-brand-2)); color: #fff;
    font-family: inherit; font-weight: 700; font-size: 1rem;
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    box-shadow: 0 10px 22px -8px rgba(37, 99, 235, .6), inset 0 1px 0 rgba(255,255,255,.2);
    transition: transform .2s, box-shadow .2s, opacity .2s;
}
.rg-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(37, 99, 235, .65); }
.rg-submit:disabled { opacity: .75; cursor: progress; transform: none; }
.rg-note { margin: 1rem 0 0; font-size: .8rem; color: var(--rg-muted); display: flex; gap: .5rem; align-items: flex-start; line-height: 1.55; }
.rg-note i { color: var(--rg-brand); margin-top: 3px; }

/* Responsive */
@media (max-width: 980px) {
    .rg-page { grid-template-columns: 1fr; }
    .rg-side { display: none; }
    .rg-top .rg-logo { visibility: visible; }
    .rg-main { padding: 20px 20px; }
}
@media (max-width: 520px) {
    .rg-grid { grid-template-columns: 1fr; }
    .rg-title { font-size: 1.6rem; }
    .rg-form-wrap { padding: 24px 0; }
}
@media (prefers-reduced-motion: reduce) {
    .rg-root > .alert { animation: none; }
}

/* ── Shared extras: login & password reset ── */
.rg-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: .45rem; }
.rg-label-row .rg-label { margin: 0; }
.rg-link { color: var(--rg-brand) !important; font-weight: 600; font-size: .84rem; }
.rg-link:hover { text-decoration: underline; }
.rg-or { display: flex; align-items: center; gap: 12px; margin: 1.6rem 0 1.2rem; color: var(--rg-muted); font-size: .82rem; }
.rg-or::before, .rg-or::after { content: ''; flex: 1; height: 1px; background: var(--rg-line); }
.rg-secondary {
    width: 100%; height: 50px; border-radius: 13px; border: 1.5px solid var(--rg-line); background: #fff;
    color: var(--rg-ink) !important; font-weight: 600; font-size: .95rem;
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem; transition: border-color .2s, color .2s, transform .2s;
}
.rg-secondary:hover { border-color: #c7d2fe; color: var(--rg-brand) !important; transform: translateY(-1px); }
.rg-icon-badge { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 1.2rem; background: #eef4ff; color: var(--rg-brand); }
.rg-otp { letter-spacing: .6em; font-size: 1.4rem !important; font-weight: 700; text-align: center; padding-left: 14px !important; height: 58px !important; }
.rg-otp::placeholder { letter-spacing: .3em; font-size: 1rem; font-weight: 400; }
.rg-mini-links { display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 1.6rem; font-size: .84rem; color: var(--rg-muted); }
.rg-mini-links a { color: var(--rg-muted) !important; display: inline-flex; gap: .4rem; align-items: center; }
.rg-mini-links a:hover { color: var(--rg-brand) !important; }
.rg-features { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.rg-features li { display: flex; gap: .75rem; align-items: center; color: rgba(255,255,255,.88); font-weight: 500; }
.rg-features i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.14); font-size: .8rem; flex-shrink: 0; }

/* Mobile: start the form near the top instead of centring it vertically */
@media (max-width: 980px) {
    .rg-form-wrap { margin: 0 auto; padding-top: 28px; }
}
