/* Staff sign-in, password reset and two-factor pages (layouts/guest). Full-screen split layout. */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }
.auth2-body { margin: 0; background: #fff; min-height: 100vh; font-family: var(--font-display); }
.auth2-body input, .auth2-body button { font-family: inherit; }
.auth2 { display: grid; grid-template-columns: minmax(440px, 40%) minmax(0, 1fr); min-height: 100vh; }

/* ---------- form side ---------- */
.auth2-form { position: relative; display: flex; flex-direction: column; padding: 1.5rem clamp(1.5rem, 3.5vw, 4rem); overflow: hidden; background: linear-gradient(145deg, #F3F6F9 0%, #F8FAFC 62%, #F5F7FA 100%); }
.auth2-form::before { content: ""; position: absolute; width: 22rem; height: 22rem; right: -13rem; top: -10rem; background: linear-gradient(145deg, rgba(22,119,200,.09), rgba(217,75,75,.035)); transform: rotate(24deg); border-radius: 4rem; pointer-events: none; }
.auth2-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .85rem; }
.auth2-back { display: inline-flex; align-items: center; gap: .35rem; color: var(--n500); font-weight: 600; padding: .45rem .75rem; border-radius: 10px; transition: background-color .2s, color .2s; }
.auth2-back:hover { background: var(--n100); color: var(--primary-700); text-decoration: none; }
.auth2-back .icon { transition: transform .25s; }
.auth2-back:hover .icon { transform: translateX(-3px); }
.auth2-mobile-hero { display: none; }
.auth2-card { position: relative; z-index: 1; width: 100%; max-width: 30rem; margin: auto; padding: clamp(1.6rem, 2.4vw, 2.25rem); background: #fff; border: 1px solid #DFE6ED; border-radius: 16px; box-shadow: 0 24px 60px -34px rgba(15,38,61,.38), 0 6px 18px -12px rgba(15,79,138,.16); }
.auth2-logo { display: block; width: 100%; max-width: 15.5rem; height: auto; margin: 0 auto .75rem; }
.auth2-system { display: flex; align-items: center; justify-content: center; gap: .55rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--n500); margin-bottom: 2.2rem; text-align: center; }
.auth2-system span { width: 26px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--brand-red), var(--primary)); }
.auth2-card h1, .auth2-title { font-family: var(--font-display); font-size: clamp(1.9rem, 2.2vw, 2.4rem); font-weight: 800; letter-spacing: -.025em; margin: 0 0 .35rem; color: var(--n900); }
.auth2-card .lead, .auth2-sub { color: var(--n500); margin: 0 0 1.8rem; font-size: 1rem; }
.auth2-card .alert { border-radius: 12px; }

/* fields */
.auth2-card .stack > * + *, .auth2-fields > * + * { margin-top: 1.1rem; }
.auth2-card .field label { font-size: .84rem; font-weight: 700; color: var(--n700); margin-bottom: .45rem; }
.auth2-card .field .req { display: none; }
.auth2-card input[type=email], .auth2-card input[type=password], .auth2-card input[type=text], .auth2-card input[type=number] {
    min-height: 54px; border-radius: 10px; border: 1px solid #CBD5E1; background: #F8FAFC; font-size: 1rem; padding: .8rem 1rem;
    transition: border-color .2s, box-shadow .2s, background-color .2s; }
.auth2-card .input-icon > input { padding-left: 2.9rem; }
.auth2-card .input-icon > .icon { left: 1rem; width: 19px; height: 19px; transition: color .2s; }
.auth2-card .input-icon:focus-within > .icon { color: var(--primary); }
.auth2-card input:hover { border-color: #B9C6D6; }
.auth2-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22, 119, 200, .11); background: #fff; }
.auth2-card .toggle-pw { right: .6rem; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; transition: background-color .2s, color .2s; }
.auth2-card .toggle-pw:hover, .auth2-card .toggle-pw.on { background: var(--primary-50); color: var(--primary); }
.caps-hint { display: none; margin-top: .4rem; font-size: .78rem; font-weight: 600; color: var(--warning-700); }
.caps-hint.show { display: block; }
.auth2-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .84rem; }
.auth2-row .muted { display: inline-flex; align-items: center; gap: .35rem; }
.auth2-row a { font-weight: 700; }

/* primary button (also restyles .btn-primary on the reset / 2FA pages) */
.auth2-submit, .auth2-card .btn-primary { position: relative; overflow: hidden; width: 100%; min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 0; border-radius: 10px; cursor: pointer;
    font: inherit; font-weight: 700; font-size: 1rem; color: #fff; background: var(--primary-700);
    box-shadow: 0 10px 20px -12px rgba(15, 79, 138, .72); transition: transform .2s, box-shadow .2s, background-color .2s; }
.auth2-submit:hover, .auth2-card .btn-primary:hover { background: #0B3A66; transform: translateY(-1px); box-shadow: 0 14px 24px -12px rgba(15, 79, 138, .66); }
.auth2-submit:active { transform: translateY(0) scale(.99); }
.auth2-submit::after, .auth2-card .btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s; }
.auth2-submit:hover::after, .auth2-card .btn-primary:hover::after { transform: translateX(120%); }
.auth2-submit .icon { transition: transform .25s; }
.auth2-submit:hover .icon { transform: translateX(3px); }
.auth2-submit .spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
.auth2-submit.busy .spinner { display: inline-block; }
.auth2-submit.busy .icon { display: none; }
.auth2-submit.busy .label::after { content: "…"; }
.auth2-submit[disabled] { cursor: progress; filter: saturate(.8); }
@keyframes spin { to { transform: rotate(360deg); } }

/* demo accounts */
.auth2-demo { margin-top: 1.4rem; border: 1px solid #DFE6ED; background: #F8FAFC; border-radius: 10px; padding: 0 1rem; }
.auth2-demo summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: .8rem 0; font-weight: 700; font-size: .88rem; color: var(--primary-700); }
.auth2-demo summary::-webkit-details-marker { display: none; }
.auth2-demo summary span { display: inline-flex; align-items: center; gap: .45rem; }
.auth2-demo summary small { color: var(--n500); font-weight: 600; }
.auth2-demo summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--primary-700); border-bottom: 2px solid var(--primary-700); transform: rotate(45deg); margin-left: .6rem; transition: transform .25s; }
.auth2-demo[open] summary::after { transform: rotate(-135deg); }
.auth2-demo summary small { margin-left: auto; }
.auth2-demo p { margin: 0 0 .7rem; font-size: .8rem; color: var(--n600); }
.auth2-demo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; padding-bottom: 1rem; }
.auth2-demo-grid button { font: inherit; font-size: .76rem; font-weight: 600; padding: .45rem .4rem; border-radius: 9px; border: 1px solid #FDE3B0; background: #fff; color: var(--n700); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: border-color .2s, background-color .2s, color .2s, transform .2s; }
.auth2-demo-grid button:hover { border-color: var(--primary); color: var(--primary-700); transform: translateY(-1px); }
.auth2-demo-grid button.picked { background: var(--primary); border-color: var(--primary); color: #fff; }
.auth2-help { text-align: center; color: var(--n500); font-size: .84rem; margin: 1.6rem 0 0; }
.auth2-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .76rem; color: var(--n500); padding-top: 1rem; border-top: 1px solid rgba(188, 205, 220, .72); }

/* Keep the complete sign-in form visible on laptop/short desktop screens. */
@media (min-width: 861px) {
    html.auth-root, .auth2-body { height: 100%; overflow: hidden; }
    .auth2 { height: 100svh; min-height: 0; }
    .auth2-form { height: 100svh; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
    .auth2-card { align-self: center; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
    .auth2-card::-webkit-scrollbar { display: none; }
}

@media (min-width: 861px) and (max-height: 850px) {
    .auth2-form { padding-top: .75rem; padding-bottom: .7rem; }
    .auth2-top { min-height: 30px; font-size: .8rem; }
    .auth2-card { max-width: 29rem; padding: 1.1rem 1.45rem 1rem; border-radius: 14px; }
    .auth2-logo { max-width: 13rem; margin-bottom: .35rem; }
    .auth2-system { margin-bottom: .8rem; font-size: .62rem; line-height: 1.25; }
    .auth2-card h1, .auth2-title { font-size: 1.7rem; margin-bottom: .18rem; }
    .auth2-card .lead, .auth2-sub { margin-bottom: .9rem; font-size: .9rem; }
    .auth2-card .stack > * + *, .auth2-fields > * + * { margin-top: .65rem; }
    .auth2-card .field label { margin-bottom: .28rem; font-size: .78rem; }
    .auth2-card input[type=email], .auth2-card input[type=password], .auth2-card input[type=text], .auth2-card input[type=number] { min-height: 44px; padding-top: .55rem; padding-bottom: .55rem; border-radius: 9px; font-size: .92rem; }
    .auth2-row { font-size: .76rem; }
    .auth2-submit, .auth2-card .btn-primary { min-height: 44px; border-radius: 9px; font-size: .92rem; }
    .auth2-demo { margin-top: .7rem; border-radius: 9px; }
    .auth2-demo summary { padding: .55rem 0; font-size: .8rem; }
    .auth2-demo p { margin-bottom: .5rem; }
    .auth2-demo-grid { padding-bottom: .7rem; }
    .auth2-help { margin-top: .7rem; font-size: .76rem; }
    .auth2-foot { padding-top: .55rem; font-size: .68rem; }
}

@media (min-width: 861px) and (max-height: 680px) {
    .auth2-card { padding: .85rem 1.25rem .75rem; }
    .auth2-logo { max-width: 11rem; }
    .auth2-system { margin-bottom: .55rem; }
    .auth2-card h1, .auth2-title { font-size: 1.5rem; }
    .auth2-card .lead, .auth2-sub { margin-bottom: .65rem; }
    .auth2-card .stack > * + *, .auth2-fields > * + * { margin-top: .5rem; }
    .auth2-help { display: none; }
}

/* ---------- brand side ---------- */
.auth2-art { position: sticky; top: 0; height: 100vh; overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(1.5rem, 3vw, 3rem); background: var(--primary-700); }
.auth2-photo { position: absolute; inset: -3%; background: center / cover no-repeat; animation: auth2-kb 26s ease-in-out infinite alternate; }
@keyframes auth2-kb { from { transform: scale(1); } to { transform: scale(1.09) translate(-1.5%, -1%); } }
.auth2-shade { position: absolute; inset: 0; background:
    linear-gradient(180deg, rgba(11, 58, 102, .5) 0%, rgba(11, 58, 102, .2) 22%, rgba(11, 58, 102, .72) 48%, rgba(8, 40, 72, .97) 100%),
    linear-gradient(90deg, rgba(11, 58, 102, .55) 0%, transparent 60%); }
.auth2-art > *:not(.auth2-photo):not(.auth2-shade) { position: relative; z-index: 1; }
.auth2-art-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.auth2-brand { display: flex; align-items: center; gap: .75rem; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: .5rem .9rem .5rem .5rem; border-radius: 16px; }
.auth2-brand img { width: 40px; height: auto; background: #fff; border-radius: 10px; padding: 3px; }
.auth2-brand strong { display: block; font-family: var(--font-display); font-size: .95rem; letter-spacing: .02em; }
.auth2-brand small { color: #CFE2F5; font-size: .74rem; }
.auth2-clock { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; font-weight: 600; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(12px); padding: .5rem .85rem; border-radius: 999px; font-variant-numeric: tabular-nums; }
.auth2-art-body { max-width: 44rem; }
.auth2-eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; background: var(--brand-red); padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1.1rem; box-shadow: 0 10px 24px -10px rgba(217, 75, 75, .8); }
.auth2-headline, .auth2-art-custom h2 { font-family: var(--font-display); color: #fff; font-size: clamp(2.2rem, 3.4vw, 3.9rem); line-height: 1.06; font-weight: 800; letter-spacing: -.025em; margin: 0 0 1rem; text-shadow: 0 2px 30px rgba(0,0,0,.25); }
.auth2-headline em { font-style: normal; background: linear-gradient(90deg, #BFE0FF, #fff 60%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth2-lead, .auth2-art-custom p { font-size: 1.05rem; line-height: 1.7; color: #DCEBFA; max-width: 36rem; margin: 0 0 1.8rem; }
.auth2-art-custom ul { list-style: none; padding: 0; margin: 0 0 1.8rem; display: grid; gap: .55rem; }
.auth2-art-custom li { display: flex; align-items: center; gap: .55rem; color: #E5F0FB; }
.auth2-art-custom li .icon { color: #93C5FD; }
.auth2-art-icon { width: 64px; height: 64px; border-radius: 18px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; margin-bottom: 1.2rem; }
.auth2-art-icon svg { width: 32px; height: 32px; }
.auth2-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.auth2-tiles div { display: flex; flex-direction: column; gap: .7rem; padding: 1rem; border-radius: 18px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: transform .3s, background-color .3s; }
.auth2-tiles div:hover { transform: translateY(-4px); background: rgba(255,255,255,.16); }
.auth2-tiles span { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; }
.auth2-tiles div:nth-child(2) span { background: rgba(217, 75, 75, .85); }
.auth2-tiles strong { font-size: .88rem; }
.auth2-art-foot { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; font-size: .8rem; color: #CFE2F5; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.16); }
.auth2-art-foot span { display: inline-flex; align-items: center; gap: .4rem; }
.auth2-art-foot img { width: 22px; height: auto; background: #fff; border-radius: 50%; }

/* ---------- entrance ---------- */
@keyframes a2-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes a2-fade { from { opacity: 0; } to { opacity: 1; } }
.auth2-art { animation: a2-fade 1s ease both; }
.auth2-card > * { animation: a2-rise .75s var(--ease-out) both; }
.auth2-card > :nth-child(1) { animation-delay: .05s; } .auth2-card > :nth-child(2) { animation-delay: .1s; } .auth2-card > :nth-child(3) { animation-delay: .15s; }
.auth2-card > :nth-child(4) { animation-delay: .2s; } .auth2-card > :nth-child(5) { animation-delay: .25s; } .auth2-card > :nth-child(n+6) { animation-delay: .3s; }
.auth2-art-top { animation: a2-rise .8s .2s var(--ease-out) both; }
.auth2-art-body > * { animation: a2-rise .9s var(--ease-out) both; }
.auth2-art-body > :nth-child(1) { animation-delay: .3s; } .auth2-art-body > :nth-child(2) { animation-delay: .4s; } .auth2-art-body > :nth-child(3) { animation-delay: .5s; } .auth2-art-body > :nth-child(n+4) { animation-delay: .6s; }
.auth2-art-foot { animation: a2-rise .9s .7s var(--ease-out) both; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .auth2 { grid-template-columns: minmax(420px, 48%) minmax(0, 1fr); }
    .auth2-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .auth2 { grid-template-columns: 1fr; }
    .auth2-art { display: none; }
    .auth2-form { min-height: 100svh; padding: 0; background: url('../images/brand/building.jpg') center 38% / cover no-repeat; }
    .auth2-form::before { inset: 0; width: auto; height: auto; transform: none; border-radius: 0; background:
        linear-gradient(180deg, rgba(6,35,62,.38) 0%, rgba(6,35,62,.14) 32%, rgba(8,39,68,.62) 68%, rgba(8,32,56,.88) 100%),
        radial-gradient(circle at 82% 8%, rgba(72,157,225,.32), transparent 34%); }
    .auth2-mobile-hero { display: none; }
    .auth2-top { position: absolute; z-index: 3; top: max(.85rem, env(safe-area-inset-top)); left: 1rem; min-height: 38px; }
    .auth2-back { color: #fff; background: rgba(7,35,61,.48); border: 1px solid rgba(255,255,255,.24); padding: .48rem .7rem; border-radius: 999px; box-shadow: 0 6px 20px rgba(3,20,36,.18); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
    .auth2-back:hover { color: #fff; background: rgba(255,255,255,.18); }
    .auth2-card { width: 100%; max-width: none; margin: auto 0 0; padding: 1.45rem max(1.25rem, env(safe-area-inset-right)) max(1.15rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left)); border: 0; border-radius: 28px 28px 0 0; background: linear-gradient(180deg, rgba(255,255,255,.99), #F8FAFC 100%); box-shadow: 0 -24px 70px rgba(3,24,43,.28); }
    .auth2-card > * { width: 100%; max-width: 27rem; margin-left: auto; margin-right: auto; }
    .auth2-logo { max-width: 10rem; margin-bottom: .4rem; }
    .auth2-system { margin-bottom: 1rem; font-size: .59rem; line-height: 1.3; letter-spacing: .105em; }
    .auth2-system span { width: 20px; }
    .auth2-card h1, .auth2-title { font-size: 1.65rem; line-height: 1.12; margin-bottom: .2rem; letter-spacing: -.035em; }
    .auth2-card .lead, .auth2-sub { margin-bottom: 1rem; font-size: .86rem; }
    .auth2-card .stack > * + *, .auth2-fields > * + * { margin-top: .7rem; }
    .auth2-card .field label { margin-bottom: .32rem; font-size: .76rem; }
    .auth2-card input[type=email], .auth2-card input[type=password], .auth2-card input[type=text], .auth2-card input[type=number] { min-height: 46px; padding-top: .58rem; padding-bottom: .58rem; border-radius: 11px; border-color: #CBD6E2; background: #fff; font-size: .9rem; }
    .auth2-row { justify-content: flex-end; font-size: .75rem; }
    .auth2-row .muted { display: none; }
    .auth2-submit, .auth2-card .btn-primary { min-height: 46px; border-radius: 11px; font-size: .9rem; background: linear-gradient(135deg, #1267A9, #0B477A); box-shadow: 0 12px 24px -14px rgba(7,65,110,.8); }
    .auth2-demo { margin-top: .75rem; border: 1px solid #DCE5ED; border-radius: 11px; background: rgba(255,255,255,.72); }
    .auth2-demo summary { padding: .58rem 0; font-size: .78rem; }
    .auth2-demo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth2-help, .auth2-foot { display: none; }
}

@media (max-width: 860px) and (max-height: 620px) {
    .auth2-card { padding-top: .95rem; padding-bottom: max(.7rem, env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
    .auth2-logo { max-width: 8.75rem; margin-bottom: .2rem; }
    .auth2-system { display: none; }
    .auth2-card h1, .auth2-title { font-size: 1.5rem; }
    .auth2-card .lead, .auth2-sub { margin-bottom: .7rem; }
    .auth2-card .stack > * + *, .auth2-fields > * + * { margin-top: .52rem; }
    .auth2-card input[type=email], .auth2-card input[type=password], .auth2-card input[type=text], .auth2-card input[type=number], .auth2-submit, .auth2-card .btn-primary { min-height: 43px; }
    .auth2-demo { margin-top: .58rem; }
    .auth2-demo summary { padding: .48rem 0; }
}

/* ---------- large & ultra-wide: scale everything with the viewport ---------- */
@media (min-width: 1680px) {
    html.auth-root { font-size: calc(9.6px + .38vw); }
    .auth2 { grid-template-columns: minmax(0, 36%) minmax(0, 1fr); }
    .auth2-card { max-width: 32rem; }
    .auth2-card input[type=email], .auth2-card input[type=password], .auth2-card input[type=text], .auth2-card input[type=number], .auth2-submit, .auth2-card .btn-primary { min-height: 3.4rem; }
    .auth2-card .input-icon > .icon, .icon { width: 1.15rem; height: 1.15rem; } .icon-sm { width: .95rem; height: .95rem; }
    .auth2-brand img { width: 2.5rem; } .auth2-tiles span { width: 2.5rem; height: 2.5rem; }
    .auth2-headline, .auth2-art-custom h2 { font-size: 3.6rem; }
    .auth2-art-body { max-width: 52rem; }
}
@media (min-width: 1680px) and (min-aspect-ratio: 2 / 1) { .auth2 { grid-template-columns: minmax(0, 32%) minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) {
    .auth2-photo, .auth2-art, .auth2-card > *, .auth2-art-top, .auth2-art-body > *, .auth2-art-foot { animation: none !important; }
}
