/* Sign-in page (login.aspx). Self-contained: no Bootstrap or theme CSS. */

:root {
    --bg: #f3f5f9;
    --card: #ffffff;
    --text: #141b2d;
    --muted: #5b6475;
    --border: #dde3ec;
    --input-bg: #ffffff;
    --primary: #1a5fa0;
    --primary-hover: #154f86;
    --primary-ring: rgba(26, 95, 160, .22);
    --button-bg: var(--primary);
    --button-hover: var(--primary-hover);
    --error-bg: #fdeeee;
    --error-border: #f4c7c7;
    --error-text: #9f1d1d;
    --info-bg: #ebf3fc;
    --info-border: #c8ddf3;
    --info-text: #174a7c;
    --warn-text: #9a5b00;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -8px rgba(16, 24, 40, .12);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c1220;
        --card: #141c2d;
        --text: #e8edf6;
        --muted: #9aa6ba;
        --border: #28344d;
        --input-bg: #0f1626;
        --primary: #3d8ad6;
        --primary-hover: #5a9de0;
        --button-bg: #2a6cb0;
        --button-hover: #3179c2;
        --primary-ring: rgba(61, 138, 214, .35);
        --error-bg: #361719;
        --error-border: #5b2a2e;
        --error-text: #ffb3b3;
        --info-bg: #13283f;
        --info-border: #234466;
        --info-text: #b8d6f6;
        --warn-text: #f3c26b;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -12px rgba(0, 0, 0, .6);
    }
}

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

html, body { height: 100%; margin: 0; }

body {
    font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* Layout: brand panel + form */

.auth {
    display: grid;
    grid-template-columns: minmax(360px, 44%) 1fr;
    min-height: 100vh;
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
    padding: 48px 56px;
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(900px 520px at 0% 0%, rgba(255, 255, 255, .14), transparent 60%),
        radial-gradient(700px 500px at 110% 110%, rgba(83, 167, 255, .35), transparent 60%),
        linear-gradient(155deg, #0a1f3a 0%, #113a66 55%, #1a5fa0 100%);
}

.auth-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .7), transparent 75%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .7), transparent 75%);
    pointer-events: none;
}

.auth-brand > * { position: relative; z-index: 1; }

.brand-logo, .mobile-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-weight: 700;
    font-size: 20px;
    color: #fff;
    background: linear-gradient(140deg, #3d8ad6, #1a5fa0);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 6px 16px -4px rgba(0, 0, 0, .35);
}

.brand-name {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: .18em;
}

.brand-copy h1 {
    margin: 0 0 16px;
    max-width: 460px;
    font-size: clamp(30px, 3.1vw, 42px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -.02em;
}

.brand-copy p {
    margin: 0 0 32px;
    max-width: 440px;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .8);
}

.brand-points {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.brand-points li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 15px;
    color: rgba(255, 255, 255, .9);
}

.brand-points svg {
    flex: none;
    width: 20px;
    height: 20px;
    padding: 3px;
    margin-top: 1px;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .16);
}

.brand-foot {
    font-size: 13px;
    color: rgba(255, 255, 255, .6);
}

.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 36px 28px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.mobile-logo, .mobile-foot { display: none; }

/* Card content */

.card-head { margin-bottom: 24px; }

.card-head h2 {
    margin: 0 0 6px;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.015em;
}

.card-head p { margin: 0; }

.muted { color: var(--muted); }

.avatar {
    display: block;
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px var(--card), 0 0 0 4px var(--border);
}

.badge-icon {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    border-radius: 14px;
    color: var(--primary);
    background: var(--info-bg);
    border: 1px solid var(--info-border);
}

.badge-icon svg { width: 26px; height: 26px; }

.field { margin-bottom: 18px; }

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}

.input-wrap { position: relative; }

.input-wrap .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.field input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.input-wrap input { padding-left: 42px; padding-right: 48px; }

.field input::placeholder { color: var(--muted); opacity: .7; }

.field input:hover { border-color: color-mix(in srgb, var(--border) 60%, var(--muted)); }

.field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.reveal {
    position: absolute;
    right: 6px;
    top: 50%;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    transform: translateY(-50%);
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.reveal:hover { color: var(--text); background: rgba(127, 127, 127, .12); }
.reveal:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.reveal svg { width: 19px; height: 19px; }
.reveal .eye-closed, .reveal.is-on .eye-open { display: none; }
.reveal.is-on .eye-closed { display: block; }

.hint {
    margin: 6px 0 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--warn-text);
}

.otp-input.otp-input {
    height: 60px;
    padding: 0 0 0 .55em;
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: .55em;
    font-variant-numeric: tabular-nums;
}

.otp-input::placeholder { letter-spacing: .55em; opacity: .35; }

/* Messages: asp:Label renders an empty span when there is nothing to say */

.alert {
    display: block;
    margin: 0 0 18px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.45;
    border: 1px solid;
    border-radius: 10px;
}

.alert:empty { display: none; }
.alert-error { color: var(--error-text); background: var(--error-bg); border-color: var(--error-border); }
.alert-info { color: var(--info-text); background: var(--info-bg); border-color: var(--info-border); }

/* Buttons and links */

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    margin-top: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

.btn-primary {
    color: #fff;
    background: var(--button-bg);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.btn-primary:hover { background: var(--button-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-ring); }

.btn.is-loading { pointer-events: none; opacity: .9; }

.btn.is-loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.link {
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    border-radius: 4px;
}

.link:hover { text-decoration: underline; }
.link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.link[aria-disabled="true"] { color: var(--muted); font-weight: 500; pointer-events: none; text-decoration: none; }

.otp-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    font-size: 14px;
}

.link-back {
    display: block;
    width: fit-content;
    margin: 10px auto 0;
    font-size: 14px;
}

.card-foot {
    margin: 28px 0 0;
    padding-top: 18px;
    font-size: 13px;
    text-align: center;
    border-top: 1px solid var(--border);
}

/* Narrow screens: drop the brand panel, keep a compact logo */

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-main { justify-content: flex-start; padding: 40px 16px 24px; }
    .mobile-logo { display: flex; margin-bottom: 28px; }
    .mobile-logo .brand-name { color: var(--text); }
    .mobile-foot { display: block; margin-top: 24px; font-size: 13px; }
}

@media (max-width: 480px) {
    .auth-main { padding-top: 24px; }
    .auth-card { padding: 28px 20px 22px; border-radius: 14px; }
    .card-head h2 { font-size: 24px; }
}

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