/* Global OSHA — login / sign-up pages (split screen, logo purple #6c5dd3) */
:root {
    --a-brand: #6c5dd3;
    --a-brand-700: #4a3bab;
    --a-brand-950: #150f3d;
    --a-brand-300: #b9b0f5;
    --a-brand-100: #ece9ff;
    --a-brand-50: #f6f4ff;
    --a-ink: #1b1740;
    --a-text: #5b5878;
    --a-muted: #8f8cab;
    --a-border: #e6e3f5;
    --a-danger: #d9344f;
    --a-success: #1f9d6c;
    --a-warn: #e59a18;
    --a-grad: linear-gradient(135deg, #7b6cf0 0%, #6c5dd3 45%, #4a3bab 100%);
    --a-grad-deep: linear-gradient(150deg, #150f3d 0%, #2a1f73 50%, #5243b8 100%);
}

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

body.auth {
    margin: 0;
    min-height: 100vh;
    background: var(--a-brand-50);
    color: var(--a-text);
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
.auth a { color: var(--a-brand); text-decoration: none; font-weight: 500; }
.auth a:hover { color: var(--a-brand-700); }
.auth h1, .auth h2, .auth h3 { font-family: 'Nunito', sans-serif; color: var(--a-ink); margin: 0; line-height: 1.2; }
.auth :focus-visible { outline: 3px solid var(--a-brand-300); outline-offset: 2px; }

.auth-shell { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(420px, 1.05fr); min-height: 100vh; }

/* ---------- Brand panel ---------- */
.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 44px 56px;
    background: var(--a-grad-deep);
    color: rgba(255, 255, 255, .86);
    isolation: isolate;
}
.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, .10) 1.2px, transparent 1.2px);
    background-size: 24px 24px;
    mask-image: linear-gradient(180deg, #000 20%, transparent 95%);
    -webkit-mask-image: linear-gradient(180deg, #000 20%, transparent 95%);
}
.auth-brand::after {
    content: '';
    position: absolute;
    z-index: -1;
    width: 560px;
    height: 560px;
    right: -220px;
    top: -200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(185, 176, 245, .38), transparent 65%);
}
.auth-orb { position: absolute; z-index: -1; left: -140px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; border: 70px solid rgba(255, 255, 255, .05); }
.auth-logo { display: inline-flex; align-self: flex-start; padding: 10px 16px; background: #fff; border-radius: 16px; box-shadow: 0 14px 30px rgba(0, 0, 0, .18); }
.auth-logo img { height: 46px; width: auto; display: block; }
.auth-brand-body { margin: auto 0; padding: 40px 0 20px; }
.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: .74rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.auth-kicker i { color: #ffc24d; }
.auth-brand h2 { color: #fff; font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 900; margin-bottom: 14px; }
.auth-brand h2 span {
    background: linear-gradient(90deg, #ffffff, #c9c1ff 60%, #b9b0f5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.auth-brand p { margin: 0 0 26px; max-width: 460px; font-size: 1.02rem; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 14px; align-items: flex-start; }
.auth-points i {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .14);
    color: #fff;
}
.auth-points strong { display: block; color: #fff; font-family: 'Nunito', sans-serif; font-size: .98rem; }
.auth-points span { font-size: .88rem; opacity: .8; }
.auth-art { width: min(300px, 70%); margin-top: 30px; align-self: flex-end; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .3)); animation: authFloat 7s ease-in-out infinite; }
.auth-art svg { width: 100%; height: auto; display: block; }
@keyframes authFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.auth-brand-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .84rem; opacity: .75; }
.auth-brand-foot a { color: #fff !important; }

/* ---------- Form panel ---------- */
.auth-main { position: relative; display: flex; flex-direction: column; padding: 32px 48px; background: #fff; }
.auth-topnav { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .9rem; }
.auth-back { display: inline-flex; align-items: center; gap: 8px; color: var(--a-text) !important; }
.auth-back i { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--a-brand-50); color: var(--a-brand); transition: transform .2s; }
.auth-back:hover i { transform: translateX(-3px); }
.auth-topnav .alt { color: var(--a-muted); }
.auth-card { width: 100%; max-width: 440px; margin: auto; padding: 36px 0; animation: authIn .6s cubic-bezier(.2, .7, .2, 1) both; }
.auth-card.wide { max-width: 520px; }
@keyframes authIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.auth-badge { width: 58px; height: 58px; margin-bottom: 20px; border-radius: 18px; display: flex; align-items: center; justify-content: center; background: var(--a-grad); color: #fff; font-size: 1.4rem; box-shadow: 0 14px 28px rgba(108, 93, 211, .35); }
.auth-card h1 { font-size: 2rem; font-weight: 900; margin-bottom: 6px; }
.auth-card .lead { margin: 0 0 28px; color: var(--a-text); }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; margin-bottom: 26px; border-radius: 14px; background: var(--a-brand-50); border: 1px solid var(--a-border); }
.auth-tabs a { padding: 10px; border-radius: 10px; text-align: center; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: .92rem; color: var(--a-text) !important; transition: background .2s, color .2s; }
.auth-tabs a.active { background: #fff; color: var(--a-brand) !important; box-shadow: 0 6px 16px rgba(42, 31, 115, .10); }
.auth-tabs a:not(.active):hover { color: var(--a-brand) !important; }

.auth-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 20px; border-radius: 14px; font-size: .92rem; animation: authShake .4s ease; }
.auth-alert i { margin-top: 3px; }
.auth-alert ul { margin: 0; padding-left: 18px; }
.auth-alert-error { background: #fdeaee; color: #a3243a; border: 1px solid #f5c3cd; }
.auth-alert-success { background: #e6f7f0; color: #146c4b; border: 1px solid #b6e7d0; }
@keyframes authShake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.auth-field { margin-bottom: 18px; }
.auth-field label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; color: var(--a-ink); font-weight: 500; font-size: .9rem; }
.auth-field label a { font-size: .84rem; }
.auth-input { position: relative; }
.auth-input > i:first-child { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--a-muted); font-size: .92rem; pointer-events: none; transition: color .2s; }
.auth-input input {
    width: 100%;
    height: 52px;
    padding: 0 48px 0 46px;
    border: 1.5px solid var(--a-border);
    border-radius: 14px;
    background: var(--a-brand-50);
    color: var(--a-ink);
    font: inherit;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth-input input::placeholder { color: #aaa7c4; }
.auth-input input:focus { outline: none; border-color: var(--a-brand); background: #fff; box-shadow: 0 0 0 4px rgba(108, 93, 211, .14); }
.auth-input:focus-within > i:first-child { color: var(--a-brand); }
.auth-input.is-invalid input { border-color: var(--a-danger); }
.auth-input.is-valid input { border-color: var(--a-success); }
.auth-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--a-muted);
    cursor: pointer;
    transition: background .2s, color .2s;
}
.auth-toggle:hover { background: var(--a-brand-100); color: var(--a-brand); }
.auth-hint { margin-top: 6px; font-size: .8rem; color: var(--a-muted); min-height: 1em; }
.auth-hint.bad { color: var(--a-danger); }
.auth-hint.good { color: var(--a-success); }

.auth-strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.auth-strength span { height: 5px; border-radius: 5px; background: var(--a-border); transition: background .25s; }
.auth-strength[data-level="1"] span:nth-child(-n+1) { background: var(--a-danger); }
.auth-strength[data-level="2"] span:nth-child(-n+2) { background: var(--a-warn); }
.auth-strength[data-level="3"] span:nth-child(-n+3) { background: #7bc043; }
.auth-strength[data-level="4"] span { background: var(--a-success); }

.auth-check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 22px; font-size: .88rem; cursor: pointer; }
.auth-check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--a-brand); flex-shrink: 0; }

.auth-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 14px;
    background: var(--a-grad);
    background-size: 150% 150%;
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(108, 93, 211, .35);
    transition: transform .2s, box-shadow .2s, background-position .4s;
}
.auth-btn:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 18px 34px rgba(108, 93, 211, .45); }
.auth-btn:disabled { opacity: .75; cursor: progress; transform: none; }
.auth-btn .spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: authSpin .7s linear infinite; }
.auth-btn.is-loading .spinner { display: inline-block; }
.auth-btn.is-loading .label-icon { display: none; }
@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-divider { display: flex; align-items: center; gap: 14px; margin: 26px 0; color: var(--a-muted); font-size: .84rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--a-border); }
.auth-alt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    border: 1.5px solid var(--a-border);
    border-radius: 14px;
    background: #fff;
    color: var(--a-ink) !important;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    transition: border-color .2s, background .2s, color .2s;
}
.auth-alt-btn:hover { border-color: var(--a-brand); background: var(--a-brand-50); color: var(--a-brand) !important; }
.auth-note { margin-top: 22px; text-align: center; font-size: .9rem; color: var(--a-muted); }
.auth-trust { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 26px; font-size: .8rem; color: var(--a-muted); }
.auth-trust span { display: inline-flex; align-items: center; gap: 6px; }
.auth-trust i { color: var(--a-brand); }

.auth-steps { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; font-size: .8rem; color: var(--a-muted); }
.auth-steps b { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--a-brand-100); color: var(--a-brand); font-size: .75rem; }
.auth-steps .on b { background: var(--a-grad); color: #fff; }
.auth-steps .on { color: var(--a-ink); font-weight: 500; }
.auth-steps .sep { flex: 1; height: 2px; max-width: 40px; background: var(--a-border); border-radius: 2px; }

/* Admin variant: darker brand panel */
.auth.admin .auth-brand { background: linear-gradient(150deg, #0d0928 0%, #1f1756 55%, #33277f 100%); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { padding: 26px 22px 34px; }
    .auth-brand-body { padding: 26px 0 0; margin: 0; }
    .auth-brand h2 { font-size: 1.7rem; }
    .auth-brand p { margin-bottom: 0; }
    .auth-points, .auth-art, .auth-brand-foot { display: none; }
    .auth-logo img { height: 38px; }
    .auth-main { padding: 22px 20px 30px; border-radius: 24px 24px 0 0; margin-top: -20px; }
    .auth-card { padding: 20px 0 0; }
}
@media (max-width: 520px) {
    .auth-grid { grid-template-columns: 1fr; }
    .auth-card h1 { font-size: 1.65rem; }
    .auth-topnav .alt { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-art, .auth-card, .auth-alert { animation: none; }
}

/* Keep the brand panel in view while the form scrolls (desktop) */
@media (min-width: 981px) {
    .auth-brand { position: sticky; top: 0; height: 100vh; overflow: hidden; }
}
@media (min-width: 981px) and (max-height: 860px) {
    .auth-art { display: none; }
    .auth-brand-body { padding-top: 24px; }
}
@media (min-width: 981px) and (max-height: 700px) {
    .auth-points li:nth-child(n+3) { display: none; }
}

/* Phones: compact brand header so the form starts on the first screen */
@media (max-width: 520px) {
    .auth-brand { padding: 18px 18px 30px; }
    .auth-logo { padding: 7px 12px; border-radius: 12px; }
    .auth-logo img { height: 32px; }
    .auth-brand-body { padding-top: 16px; }
    .auth-kicker, .auth-brand p { display: none; }
    .auth-brand h2 { font-size: 1.4rem; margin-bottom: 0; }
    .auth-main { padding: 18px 18px 28px; }
    .auth-badge { display: none; }
    .auth-card { padding-top: 14px; }
    .auth-card .lead { margin-bottom: 20px; }
    .auth-tabs { margin-bottom: 20px; }
}

/* Logo on the purple panel: white, no box */
.auth-logo { padding: 0; background: none; border-radius: 0; box-shadow: none; }
.auth-logo img { height: 58px; filter: brightness(0) invert(1); opacity: .96; transition: opacity .2s; }
.auth-logo:hover img { opacity: 1; }
@media (max-width: 980px) { .auth-logo img { height: 44px; } }
@media (max-width: 520px) { .auth-logo { padding: 0; } .auth-logo img { height: 38px; } }
