/* =====================================================================
   RacioFlow — Authentication pages
   Racio Media Group · Namibia
   ================================================================== */

.rf-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    background: var(--surface);
}

/* ---------- Brand panel --------------------------------------------- */

.rf-auth-brand {
    position: relative;
    background: #111111;
    color: #fff;
    padding: 3rem 3.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    isolation: isolate;
}

/* Angular blocks inspired by the logo mark — deliberately restrained. */
.rf-auth-brand::before,
.rf-auth-brand::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
}
.rf-auth-brand::before {
    width: 460px; height: 460px;
    right: -190px; top: -150px;
    background: var(--racio-red);
    opacity: .13;
    transform: rotate(22deg);
    border-radius: 40px;
}
.rf-auth-brand::after {
    width: 340px; height: 340px;
    left: -140px; bottom: -130px;
    background: #5A5456;
    opacity: .22;
    transform: rotate(-18deg);
    border-radius: 34px;
}

.rf-auth-shape {
    position: absolute;
    z-index: -1;
    pointer-events: none;
}
.rf-auth-shape-1 {
    width: 0; height: 0;
    right: 12%; bottom: 16%;
    border-left: 130px solid transparent;
    border-bottom: 180px solid rgba(229,3,5,.16);
}
.rf-auth-shape-2 {
    width: 120px; height: 4px;
    left: 3.25rem; top: 46%;
    background: var(--racio-red);
    opacity: .9;
}

.rf-auth-brand-logo { display: block; }
.rf-auth-brand-logo img { max-width: 260px; height: auto; display: block; }

.rf-auth-brand-copy { max-width: 30rem; }
.rf-auth-brand-copy h1 {
    font-size: clamp(1.85rem, 3.2vw, 2.6rem);
    font-weight: 750;
    letter-spacing: -.03em;
    line-height: 1.12;
    margin: 0 0 .85rem;
    color: #fff;
}
.rf-auth-brand-copy h1 .u-brand { color: var(--racio-red); }
.rf-auth-brand-copy p {
    color: #B5B5B5;
    font-size: 1rem;
    line-height: 1.65;
    margin: 0;
}

.rf-auth-features {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: .7rem 1.25rem;
}
.rf-auth-features li {
    display: flex; align-items: center; gap: .55rem;
    font-size: .875rem; color: #D4D4D4;
}
.rf-auth-features .rf-icon { color: var(--racio-red); }

.rf-auth-brand-foot {
    font-size: .75rem;
    color: #8C8C8C;
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

/* ---------- Form panel ---------------------------------------------- */

.rf-auth-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--surface);
}
.rf-auth-form {
    width: 100%;
    max-width: 400px;
}

.rf-auth-mobile-logo { display: none; margin-bottom: 1.75rem; }
.rf-auth-mobile-logo img { max-width: 190px; height: auto; }

.rf-auth-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -.025em;
    margin: 0 0 .3rem;
}
.rf-auth-subtitle {
    color: var(--text-secondary);
    font-size: .9rem;
    margin: 0 0 1.75rem;
}

.rf-auth-form .rf-field { margin-bottom: 1.05rem; }
.rf-auth-form .rf-input { min-height: 46px; font-size: .95rem; }
.rf-auth-form .rf-input-group .rf-input { padding-left: 2.6rem; }

.rf-auth-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; margin: -.25rem 0 1.35rem; flex-wrap: wrap;
}
.rf-auth-row a { font-size: .8125rem; font-weight: 600; }

.rf-auth-submit { height: 48px; font-size: .95rem; }

.rf-auth-alt {
    margin-top: 1.5rem;
    padding-top: 1.35rem;
    border-top: 1px solid var(--border-color);
    font-size: .8125rem;
    color: var(--text-muted);
    text-align: center;
}

.rf-auth-demo {
    margin-top: 1.15rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-secondary);
    font-size: .75rem;
}
.rf-auth-demo summary {
    cursor: pointer;
    padding: .65rem .85rem;
    font-weight: 650;
    color: var(--text-secondary);
    list-style: none;
    display: flex; align-items: center; gap: .4rem;
}
.rf-auth-demo summary::-webkit-details-marker { display: none; }
.rf-auth-demo[open] summary { border-bottom: 1px solid var(--border-color); }
.rf-auth-demo-body { padding: .6rem .85rem .8rem; }
.rf-auth-demo table { width: 100%; border-collapse: collapse; }
.rf-auth-demo td { padding: .25rem .3rem; color: var(--text-secondary); }
.rf-auth-demo td:first-child { color: var(--text-muted); white-space: nowrap; }
.rf-auth-demo code { background: var(--surface); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border-color); }
.rf-auth-demo button.rf-demo-fill {
    background: none; border: 0; padding: 0; color: var(--primary);
    font-family: inherit; font-size: .75rem; font-weight: 650; cursor: pointer;
}
.rf-auth-demo button.rf-demo-fill:hover { text-decoration: underline; }

.rf-auth-theme {
    position: absolute; top: 1.25rem; right: 1.5rem;
    z-index: 5;
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}
.rf-auth-theme:hover { background: var(--surface-hover); color: var(--text-primary); }

/* Password strength meter */
.rf-strength { margin-top: .45rem; }
.rf-strength-track { height: 4px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.rf-strength-bar { height: 100%; width: 0; border-radius: var(--radius-pill); transition: width var(--transition), background var(--transition); }
.rf-strength-bar.is-weak   { background: var(--danger);  width: 33%; }
.rf-strength-bar.is-medium { background: var(--warning); width: 66%; }
.rf-strength-bar.is-strong { background: var(--success); width: 100%; }
.rf-strength-text { font-size: .6875rem; color: var(--text-muted); margin-top: .25rem; }

/* ---------- Responsive ---------------------------------------------- */

@media (max-width: 1024px) {
    .rf-auth-brand { padding: 2.5rem; }
    .rf-auth-features { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 880px) {
    .rf-auth { grid-template-columns: minmax(0,1fr); }
    .rf-auth-brand { display: none; }
    .rf-auth-mobile-logo { display: block; }
    .rf-auth-panel { padding: 2.5rem 1.25rem; align-items: flex-start; min-height: 100vh; }
    .rf-auth-form { max-width: 420px; margin: 0 auto; }
}

@media (max-width: 480px) {
    .rf-auth-panel { padding: 2rem 1.1rem 3rem; }
    .rf-auth-title { font-size: 1.4rem; }
}

/* =====================================================================
   Professional login composition
   ================================================================== */

body.rf-login-page {
    min-width: 320px;
    min-height: 100vh;
    background: #f4f4f5;
}

html.rf-login-document,
html.rf-login-document body.rf-login-page {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.rf-login-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(420px, .92fr) minmax(520px, 1.08fr);
}

.rf-login-brand {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: clamp(2rem, 4vw, 4.25rem);
    color: #fff;
    background:
        radial-gradient(circle at 85% 10%, rgba(229,3,5,.20), transparent 28%),
        linear-gradient(145deg, #080808 0%, #151515 58%, #0d0d0d 100%);
}

.rf-login-brand::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 360px;
    height: 560px;
    right: -205px;
    bottom: -180px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 90px;
    transform: rotate(28deg);
}

.rf-login-brand::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 220px;
    height: 220px;
    right: 8%;
    top: 32%;
    border-radius: 52px;
    background: rgba(229,3,5,.08);
    transform: rotate(28deg);
}

.rf-login-brand-glow {
    position: absolute;
    z-index: -1;
    inset: auto auto -220px -190px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: rgba(90,84,86,.13);
    filter: blur(2px);
}

.rf-login-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    width: fit-content;
    color: #fff;
}
.rf-login-brand-link:hover { color: #fff; }

.rf-login-logo-tile {
    width: 104px;
    height: 104px;
    flex: none;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 5px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 25px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(0,0,0,.24);
}
.rf-login-logo-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rf-login-product { display: flex; flex-direction: column; line-height: 1.15; }
.rf-login-product strong { color: #fff; font-size: 1.2rem; letter-spacing: -.02em; }
.rf-login-product small { margin-top: .3rem; color: #a3a3a3; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; }

.rf-login-brand-body {
    width: min(100%, 600px);
    margin: auto 0;
    padding: 4rem 0;
}
.rf-login-eyebrow,
.rf-login-kicker {
    display: inline-flex;
    align-items: center;
    color: var(--racio-red);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.rf-login-eyebrow::before {
    content: "";
    width: 32px;
    height: 2px;
    margin-right: .65rem;
    background: var(--racio-red);
}
.rf-login-brand-body h1 {
    max-width: 620px;
    margin: 1.25rem 0 1.15rem;
    color: #fff;
    font-size: clamp(2.35rem, 3.45vw, 3.45rem);
    font-weight: 650;
    line-height: 1.06;
    letter-spacing: -.045em;
}
.rf-login-headline {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: .04em;
}
.rf-login-headline > span {
    display: block;
    opacity: 0;
    transform: translateY(10px);
    animation: rf-login-copy-in 440ms cubic-bezier(.22, 1, .36, 1) forwards;
}
.rf-login-headline > span:last-child {
    color: #c7c7c7;
    font-size: .76em;
    font-weight: 500;
    letter-spacing: -.025em;
    animation-delay: 90ms;
}
.rf-login-headline em {
    color: var(--racio-red);
    font-style: normal;
}
@keyframes rf-login-copy-in {
    to { opacity: 1; transform: translateY(0); }
}
.rf-login-brand-body > p {
    max-width: 550px;
    margin: 0;
    color: #a8a8a8;
    font-size: .96rem;
    line-height: 1.7;
}

@media (prefers-reduced-motion: reduce) {
    .rf-login-headline > span {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

.rf-login-capabilities {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin-top: 2.25rem;
}
.rf-login-capabilities > div {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-width: 0;
    padding: .9rem 1rem;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    background: rgba(255,255,255,.035);
}
.rf-login-capabilities .rf-icon { color: var(--racio-red); }
.rf-login-capabilities span { display: flex; min-width: 0; flex-direction: column; }
.rf-login-capabilities strong { color: #f8f8f8; font-size: .82rem; font-weight: 600; }
.rf-login-capabilities small { color: #858585; font-size: .72rem; }

.rf-login-brand-foot {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255,255,255,.08);
    color: #8C8C8C;
    font-size: .72rem;
}

.rf-login-access {
    position: relative;
    display: grid;
    place-items: center;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: clamp(1.5rem, 4vw, 4rem);
    background:
        linear-gradient(rgba(229,3,5,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(229,3,5,.025) 1px, transparent 1px),
        #f5f5f6;
    background-size: 42px 42px;
}

/* Authentication surfaces follow the same light/dark preference as the app. */
:root[data-theme="dark"] body.rf-login-page { background: var(--background); }
:root[data-theme="dark"] .rf-login-access {
    background:
        linear-gradient(rgba(229,3,5,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(229,3,5,.035) 1px, transparent 1px),
        var(--background);
    background-size: 42px 42px;
}
:root[data-theme="dark"] .rf-login-card {
    border-color: var(--border-color);
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(0,0,0,.42);
}
:root[data-theme="dark"] .rf-login-card-head h1,
:root[data-theme="dark"] .rf-login-form .rf-label,
:root[data-theme="dark"] .rf-login-mobile-brand strong { color: var(--text-primary); }
:root[data-theme="dark"] .rf-login-card-head p,
:root[data-theme="dark"] .rf-login-remember,
:root[data-theme="dark"] .rf-login-help,
:root[data-theme="dark"] .rf-login-mobile-brand small { color: var(--text-secondary); }
:root[data-theme="dark"] .rf-login-form .rf-input {
    border-color: var(--border-strong);
    background: var(--surface-secondary);
    color: var(--text-primary);
}
:root[data-theme="dark"] .rf-login-form .rf-hint { color: var(--text-muted); }
:root[data-theme="dark"] .rf-login-help { border-top-color: var(--border-color); }
:root[data-theme="dark"] .rf-login-help .rf-icon { color: var(--text-secondary); }

.rf-login-card {
    width: min(100%, 510px);
    padding: clamp(1.75rem, 4vw, 3rem);
    border: 1px solid #e5e5e5;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(20,20,20,.09);
}
.rf-login-card-head { margin-bottom: 1.8rem; }
.rf-login-card-head h1 {
    margin: .55rem 0 .35rem;
    color: #171717;
    font-size: clamp(1.75rem, 3vw, 2.15rem);
    font-weight: 650;
    letter-spacing: -.04em;
}
.rf-login-card-head p { margin: 0; color: #686868; font-size: .92rem; }

.rf-login-form .rf-field { margin-bottom: 1.2rem; }
.rf-login-form .rf-label { margin-bottom: .48rem; color: #303030; font-size: .79rem; font-weight: 600; }
.rf-login-form .rf-input {
    min-height: 52px;
    border-radius: 12px;
    background: #fafafa;
    font-size: .92rem;
}
.rf-login-form .rf-input-group .rf-input { padding-left: 2.8rem; }
.rf-login-form .rf-ig-icon { left: .9rem; }
.rf-login-form .rf-hint { margin-top: .42rem; color: #6B6B6B; font-size: .72rem; }

.rf-login-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.rf-login-label-row a { margin-bottom: .48rem; font-size: .75rem; font-weight: 600; }

.rf-login-remember { width: fit-content; margin: -.1rem 0 1.35rem; color: #525252; font-size: .79rem; }
.rf-login-submit {
    height: 52px;
    justify-content: space-between;
    padding-inline: 1.15rem;
    border-radius: 12px;
    font-size: .9rem;
    box-shadow: 0 10px 24px rgba(229,3,5,.19);
}
.rf-login-submit:hover { box-shadow: 0 13px 28px rgba(229,3,5,.25); }

.rf-login-demo { margin-top: 1.35rem; border-style: solid; border-radius: 12px; }
.rf-login-demo-password { margin: 0 0 .55rem; color: var(--text-muted); }
.rf-login-help {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin-top: 1.4rem;
    padding-top: 1.25rem;
    border-top: 1px solid #ececec;
    color: #6B6B6B;
    font-size: .75rem;
    line-height: 1.5;
}
.rf-login-help .rf-icon { margin-top: 1px; color: #525252; }

.rf-login-mobile-brand { display: none; align-items: center; gap: .8rem; margin-bottom: 2rem; }
.rf-login-mobile-brand .rf-login-logo-tile { width: 72px; height: 72px; padding: 4px; border-radius: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.10); }
.rf-login-mobile-brand > span:last-child { display: flex; flex-direction: column; }
.rf-login-mobile-brand strong { color: #171717; font-size: 1rem; }
.rf-login-mobile-brand small { color: #6B6B6B; font-size: .72rem; }

@media (max-width: 1080px) {
    .rf-login-shell { grid-template-columns: minmax(380px, .82fr) minmax(480px, 1.18fr); }
    .rf-login-brand { padding: 2.5rem; }
    .rf-login-logo-tile { width: 88px; height: 88px; border-radius: 22px; }
    .rf-login-capabilities { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 861px) and (max-height: 900px) {
    .rf-login-brand { padding: 1.5rem 2.5rem; }
    .rf-login-logo-tile { width: 76px; height: 76px; border-radius: 19px; }
    .rf-login-product strong { font-size: 1.05rem; }
    .rf-login-brand-body { padding: 1.25rem 0; }
    .rf-login-brand-body h1 {
        margin: .75rem 0 .7rem;
        font-size: clamp(2.15rem, 3.2vw, 2.9rem);
    }
    .rf-login-brand-body > p { font-size: .86rem; line-height: 1.55; }
    .rf-login-capabilities {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
        margin-top: 1rem;
    }
    .rf-login-capabilities > div { padding: .6rem .75rem; border-radius: 11px; }
    .rf-login-brand-foot { padding-top: .7rem; }

    .rf-login-access { padding: 1rem 2rem; }
    .rf-login-card { padding: 1.5rem 2rem; border-radius: 20px; }
    .rf-login-card-head { margin-bottom: 1rem; }
    .rf-login-card-head h1 { margin: .3rem 0 .2rem; font-size: 1.75rem; }
    .rf-login-form .rf-field { margin-bottom: .75rem; }
    .rf-login-form .rf-input { min-height: 46px; }
    .rf-login-remember { margin: 0 0 .85rem; }
    .rf-login-submit { height: 46px; }
    .rf-login-demo { margin-top: .8rem; }
    .rf-login-help { margin-top: .8rem; padding-top: .75rem; }
}

@media (max-width: 860px) {
    .rf-login-shell { display: block; }
    .rf-login-brand { display: none; }
    .rf-login-access { width: 100%; height: 100vh; height: 100dvh; min-height: 0; padding: 1rem 1.25rem; }
    .rf-login-card { width: 100%; min-width: 0; padding: 2rem; }
    .rf-login-mobile-brand { display: flex; }
}

@media (max-width: 860px) and (max-height: 740px) {
    .rf-login-card { padding-block: 1.25rem; }
    .rf-login-mobile-brand { display: none; }
    .rf-login-card-head { margin-bottom: 1rem; }
    .rf-login-card-head h1 { margin: .3rem 0 .2rem; }
    .rf-login-form .rf-field { margin-bottom: .75rem; }
    .rf-login-form .rf-input { min-height: 46px; }
    .rf-login-remember { margin-bottom: .8rem; }
    .rf-login-submit { height: 46px; }
    .rf-login-demo { margin-top: .8rem; }
    .rf-login-help { margin-top: .75rem; padding-top: .7rem; }
}

@media (max-width: 480px) {
    .rf-login-access { align-items: start; padding: 0; background: #fff; }
    .rf-login-card { width: 100%; max-width: none; height: 100vh; height: 100dvh; min-height: 0; padding: 1.5rem 1.15rem; border: 0; border-radius: 0; box-shadow: none; }
    .rf-login-card-head { margin-bottom: 1.45rem; }
    .rf-login-mobile-brand { margin-bottom: 1.65rem; }
    .rf-login-mobile-brand .rf-login-logo-tile { width: 64px; height: 64px; border-radius: 16px; }
    .rf-login-demo table td:first-child { display: none; }
    :root[data-theme="dark"] .rf-login-access { background: var(--background); }
    :root[data-theme="dark"] .rf-login-card { background: var(--surface); }
}
