/* ==========================================================================
   ERP auth pages — split-screen layout
   ========================================================================== */

:root {
    --auth-primary: #135667;      /* brand */
    --auth-primary-600: #0e4352;
    --auth-primary-400: #1d7a92;
    --auth-primary-50: #e8f2f5;
    --auth-accent: #2bb3c0;
    --auth-ink: #0f172a;
    --auth-text: #334155;
    --auth-muted: #64748b;
    --auth-line: #dfe5ec;
    --auth-surface: #ffffff;
    --auth-soft: #f6f8fa;
    --auth-danger: #dc2626;
    --auth-success: #059669;
    --auth-radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    color: var(--auth-text);
    background: var(--auth-surface);
    -webkit-font-smoothing: antialiased;
}

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

/* --------------------------------------------------------------------------
   Showcase panel
   -------------------------------------------------------------------------- */

.auth-showcase {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 64px;
    color: #d5e6ea;
    background:
        radial-gradient(900px 500px at 100% 0%, rgba(29, 122, 146, .35), transparent 65%),
        linear-gradient(165deg, #0b2a33 0%, #0e3743 100%);
    overflow: hidden;
}

.showcase-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}
.showcase-brand:hover { color: #fff; }

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary-400), var(--auth-accent));
}
.brand-mark.sm { width: 32px; height: 32px; border-radius: 8px; font-size: .85rem; }

.showcase-main { max-width: 480px; }
.showcase-main h2 {
    margin: 0 0 12px;
    font-size: clamp(1.6rem, 2.2vw, 2.1rem);
    line-height: 1.22;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #fff;
}
.showcase-main p { margin: 0 0 36px; color: #9fc1ca; line-height: 1.65; }

/* Dashboard card */
.mock-card {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
}
.mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi small { display: block; font-size: .7rem; color: #8fb3bd; text-transform: uppercase; letter-spacing: .06em; }
.kpi strong { display: block; margin: 4px 0 2px; font-size: 1.05rem; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.trend { font-size: .72rem; font-weight: 600; }
.trend.up { color: #5eead4; }
.trend.down { color: #fda4af; }

.mock-chart { display: flex; align-items: flex-end; gap: 7px; height: 96px; }
.mock-chart span {
    flex: 1;
    border-radius: 4px 4px 1px 1px;
    background: rgba(127, 211, 221, .28);
    transform-origin: bottom;
    animation: grow .8s cubic-bezier(.2, .8, .2, 1) both;
}
.mock-chart span:last-child { background: var(--auth-accent); }
.mock-chart span:nth-child(1)  { height: 38%; animation-delay: 0ms; }
.mock-chart span:nth-child(2)  { height: 52%; animation-delay: 60ms; }
.mock-chart span:nth-child(3)  { height: 44%; animation-delay: 120ms; }
.mock-chart span:nth-child(4)  { height: 63%; animation-delay: 180ms; }
.mock-chart span:nth-child(5)  { height: 57%; animation-delay: 240ms; }
.mock-chart span:nth-child(6)  { height: 72%; animation-delay: 300ms; }
.mock-chart span:nth-child(7)  { height: 66%; animation-delay: 360ms; }
.mock-chart span:nth-child(8)  { height: 84%; animation-delay: 420ms; }
.mock-chart span:nth-child(9)  { height: 78%; animation-delay: 480ms; }
.mock-chart span:nth-child(10) { height: 92%; animation-delay: 540ms; }
.mock-chart span:nth-child(11) { height: 86%; animation-delay: 600ms; }
.mock-chart span:nth-child(12) { height: 98%; animation-delay: 660ms; }
@keyframes grow { from { transform: scaleY(0); } }

.showcase-foot { display: flex; flex-wrap: wrap; gap: 24px; font-size: .8rem; color: #8fb3bd; }
.showcase-foot i { margin-right: 6px; color: var(--auth-accent); }

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

.auth-panel { display: flex; flex-direction: column; min-height: 100vh; }

.panel-top, .panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 48px;
}
.panel-top { justify-content: flex-end; min-height: 90px; }
.panel-brand {
    display: none;            /* shown on small screens, where the showcase is hidden */
    align-items: center;
    gap: 10px;
    margin-right: auto;
    font-weight: 700;
    color: var(--auth-ink);
    text-decoration: none;
}
.panel-brand > .panel-brand { display: inline-flex; margin: 0; }
.panel-brand img { max-height: 34px; width: auto; }
.panel-top-link { font-size: .875rem; color: var(--auth-muted); }
.panel-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    padding: 8px 14px 8px 10px;
    border: 1px solid var(--auth-line);
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--auth-ink);
    text-decoration: none;
    transition: color .2s, border-color .2s, background .2s;
}
.panel-home i {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: .7rem;
    color: #fff;
    background: var(--auth-primary);
    transition: transform .2s;
}
.panel-home:hover { color: var(--auth-primary); border-color: var(--auth-primary); }
.panel-home:hover i { transform: translateX(-2px); }

.panel-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }

.auth-form-wrap { width: 100%; max-width: 380px; animation: fade .4s ease both; }
.auth-form-wrap.wide { max-width: 480px; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.panel-foot { font-size: .8rem; color: var(--auth-muted); }
.panel-foot { flex-wrap: wrap; }
.panel-foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.panel-foot a { white-space: nowrap; }
.panel-foot a { color: var(--auth-muted); text-decoration: none; }
.panel-foot a:hover { color: var(--auth-primary); }

/* Heading */
.auth-title {
    margin: 0 0 8px;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--auth-ink);
}
.auth-subtitle { margin: 0 0 32px; color: var(--auth-muted); line-height: 1.6; }
.auth-subtitle strong { color: var(--auth-ink); font-weight: 600; }

/* Fields */
.field { margin-bottom: 18px; }
.field-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--auth-ink);
}
.field-label .auth-link { font-size: .82rem; }

.input-group-x { position: relative; }
.auth-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    background-color: #fff;
    color: var(--auth-ink);
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
}
.input-group-x .auth-input:has(+ .toggle-eye) { padding-right: 46px; }
select.auth-input {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.auth-input::placeholder { color: #a3adba; }
.auth-input:hover { border-color: #c5ced8; }
.auth-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(19, 86, 103, .12);
}
.auth-input.is-invalid { border-color: var(--auth-danger); }
.auth-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.field-error { display: block; margin-top: 6px; font-size: .8rem; color: var(--auth-danger); }

.toggle-eye {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}
.toggle-eye:hover { color: var(--auth-ink); }

/* Strength meter */
.strength { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.strength-bars { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength-bars i { height: 3px; border-radius: 3px; background: var(--auth-line); transition: background .2s; }
.strength-label { min-width: 60px; text-align: right; font-size: .74rem; font-weight: 600; color: var(--auth-muted); }
.strength[data-score="0"] .strength-bars i:nth-child(-n+1),
.strength[data-score="1"] .strength-bars i:nth-child(-n+1) { background: #ef4444; }
.strength[data-score="2"] .strength-bars i:nth-child(-n+2) { background: #f59e0b; }
.strength[data-score="3"] .strength-bars i:nth-child(-n+3) { background: #22c55e; }
.strength[data-score="4"] .strength-bars i { background: var(--auth-success); }

/* Checkbox */
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--auth-primary); cursor: pointer; }

/* Links */
.auth-link { color: var(--auth-primary); font-weight: 600; text-decoration: none; }
.auth-link:hover { color: var(--auth-primary-600); text-decoration: underline; text-underline-offset: 3px; }

/* Buttons */
.btn-auth {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    border: 1px solid var(--auth-primary);
    border-radius: var(--auth-radius);
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--auth-primary);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.btn-auth:hover { color: #fff; background: var(--auth-primary-600); border-color: var(--auth-primary-600); }
.btn-auth:focus-visible { outline: 3px solid rgba(19, 86, 103, .3); outline-offset: 2px; }

.btn-auth.is-loading { color: transparent; pointer-events: none; }
.btn-auth.is-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-auth-ghost { color: var(--auth-ink); background: #fff; border-color: var(--auth-line); }
.btn-auth-ghost:hover { color: var(--auth-ink); background: var(--auth-soft); border-color: #c5ced8; }

/* Alerts */
.auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 12px 14px;
    border-radius: var(--auth-radius);
    font-size: .875rem;
    line-height: 1.5;
}
.auth-alert i { margin-top: 3px; }
.auth-alert.danger { background: #fef2f2; color: #991b1b; }
.auth-alert.success { background: #ecfdf5; color: #065f46; }

.auth-footnote { margin: 28px 0 0; text-align: center; font-size: .875rem; color: var(--auth-muted); }
.auth-legal { margin: 16px 0 0; text-align: center; font-size: .78rem; color: var(--auth-muted); line-height: 1.6; }

/* Step list (verify page) */
.steps { display: grid; gap: 16px; margin: 0 0 28px; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: flex; gap: 14px; align-items: flex-start; counter-increment: step; }
.steps li::before {
    content: counter(step);
    flex: none;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: .78rem;
    font-weight: 700;
    color: var(--auth-primary);
    background: var(--auth-primary-50);
}
.steps strong { display: block; font-size: .9rem; font-weight: 600; color: var(--auth-ink); }
.steps span { font-size: .84rem; color: var(--auth-muted); }

/* Register form sections */
.form-section {
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--auth-line);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--auth-muted);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

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

@media (max-width: 1199.98px) {
    .auth-showcase { padding: 36px 44px; }
}

@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-showcase { display: none; }
    .panel-top { justify-content: space-between; min-height: 0; }
    .panel-brand { display: inline-flex; }
    /* the logo is shown here, so the home button shrinks to an icon beside it */
    .panel-home { margin-right: 0; padding: 6px; }
    .panel-home span { display: none; }
    .panel-home i { width: 26px; height: 26px; }
}

@media (max-width: 575.98px) {
    .panel-top, .panel-foot { padding: 20px 16px; }
    .hide-xs { display: none; }
    .panel-body { align-items: flex-start; padding: 16px 16px 32px; }
    .panel-foot { flex-direction: column; gap: 8px; text-align: center; }
    .auth-title { font-size: 1.45rem; }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
