/* Sign-in page — Windows 11 (Fluent) style, accent matches erp-theme.css */
:root {
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-press: #1e40af;
    --text: #1b1b1b;
    --text-2: #5d5d5d;
    --stroke: rgba(0, 0, 0, .0578);
    --stroke-strong: rgba(0, 0, 0, .4458);
    --control: rgba(255, 255, 255, .7);
    --control-hover: rgba(249, 249, 249, .5);
    --danger: #c42b1c;
    --danger-bg: #fde7e9;
    --radius: 8px;
    --radius-sm: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: "Segoe UI Variable Text", "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    /* Soft Windows 11 "bloom" desktop */
    background:
        radial-gradient(1200px 700px at 85% 110%, rgba(37, 99, 235, .35), transparent 60%),
        radial-gradient(900px 600px at 10% -10%, rgba(96, 165, 250, .35), transparent 60%),
        linear-gradient(135deg, #dbe6f6 0%, #eef2f9 50%, #dfe8f7 100%);
    background-attachment: fixed;
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 16px;
}

/* ---------- Window ---------- */
.auth-window {
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    background: rgba(243, 243, 243, .85);
    backdrop-filter: blur(30px) saturate(1.25);
    -webkit-backdrop-filter: blur(30px) saturate(1.25);
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: var(--radius);
    box-shadow: 0 32px 64px rgba(0, 0, 0, .18), 0 2px 21px rgba(0, 0, 0, .12);
}

.auth-titlebar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
    color: var(--text);
    user-select: none;
}

.auth-titlebar img { width: 16px; height: 16px; object-fit: contain; }

.auth-card {
    padding: 20px 28px 24px;
    background: #fbfbfb;
    border-top: 1px solid var(--stroke);
}

.auth-logo { display: block; height: 34px; width: auto; margin-bottom: 20px; }

.auth-card h1 {
    font-family: "Segoe UI Variable Display", "Segoe UI", Inter, sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 28px;
    margin-bottom: 2px;
}

.auth-sub { font-size: 13px; color: var(--text-2); margin-bottom: 20px; }

/* ---------- Fields ---------- */
.auth-field { margin-bottom: 14px; }

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

.auth-input-wrap { position: relative; }

/* Fluent text box: light frame, darker bottom edge, accent underline on focus */
.auth-input {
    width: 100%;
    height: 32px;
    padding: 0 11px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--control);
    border: 1px solid var(--stroke);
    border-bottom-color: var(--stroke-strong);
    border-radius: var(--radius-sm);
    outline: none;
}

.auth-input::placeholder { color: var(--text-2); }
.auth-input:hover { background: var(--control-hover); }

.auth-input:focus {
    background: #fff;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 1px;
}

.auth-input.has-toggle { padding-right: 38px; }
.auth-input.is-invalid { border-bottom: 2px solid var(--danger); padding-bottom: 1px; }

.auth-reveal {
    position: absolute;
    top: 50%;
    right: 3px;
    transform: translateY(-50%);
    width: 28px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
}

.auth-reveal:hover { background: rgba(0, 0, 0, .0373); color: var(--text); }
.auth-reveal svg { width: 15px; height: 15px; }
.auth-reveal .icon-hide { display: none; }
.auth-reveal.is-revealed .icon-show { display: none; }
.auth-reveal.is-revealed .icon-hide { display: block; }

.auth-error,
.auth-caps {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
}

.auth-error { color: var(--danger); }
.auth-caps { display: none; color: #9d5d00; }
.auth-caps.show { display: flex; }
.auth-error svg, .auth-caps svg { width: 14px; height: 14px; flex: none; }

/* Fluent InfoBar (error) */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text);
    background: var(--danger-bg);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
}

.auth-alert svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--danger); }
.auth-alert span { flex: 1; }

.auth-alert-close {
    border: 0;
    background: none;
    color: var(--text-2);
    font-size: 12px;
    cursor: pointer;
}

.auth-alert-close:hover { color: var(--text); }

/* ---------- Checkbox ---------- */
.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 20px;
    font-size: 14px;
    cursor: pointer;
}

.auth-check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* ---------- Accent button ---------- */
.auth-btn {
    width: 100%;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-size: 14px;
    color: #fff;
    background: var(--accent);
    border: 1px solid rgba(255, 255, 255, .08);
    border-bottom-color: rgba(0, 0, 0, .4);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.auth-btn:hover { background: var(--accent-hover); }
.auth-btn:active { background: var(--accent-press); color: rgba(255, 255, 255, .8); }
.auth-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.auth-btn:disabled { opacity: .8; cursor: progress; }

.auth-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
}

.auth-btn.is-loading .auth-spinner { display: inline-block; }

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

.auth-foot {
    margin-top: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-2);
}

@media (max-width: 480px) {
    .auth-card { padding: 18px 20px 22px; }
}
