:root {
    --auth-ink: #17212b;
    --auth-muted: #647383;
    --auth-primary: #263b4d;
    --auth-primary-hover: #192b39;
    --auth-surface: #fff;
    --auth-soft: #f4f6f8;
    --auth-border: #d8e0e6;
    --auth-danger: #b42318;
    --auth-ring: rgba(52, 116, 147, .24);
}

.auth-body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background: #f2f4f6;
    color: var(--auth-ink);
}

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-main {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 28px 18px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--auth-ink);
    text-decoration: none;
}

.auth-brand:hover { text-decoration: none; }

.auth-brand-mark {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: #fff;
}

.auth-brand-mark img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.auth-brand strong {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
}

.auth-brand small {
    display: block;
    margin-top: 2px;
    color: var(--auth-muted);
    font-size: .72rem;
}

.auth-card {
    width: min(440px, 100%);
    padding: 30px;
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    background: var(--auth-surface);
    box-shadow: 0 10px 28px rgba(31, 48, 61, .07);
}

.auth-system-note {
    margin: 0;
    color: var(--auth-muted);
    font-size: .72rem;
}

.auth-form-header { margin-bottom: 24px; }

.auth-form-header h2 {
    margin: 0;
    color: var(--auth-ink);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.25;
}

.auth-form-header p {
    margin: 7px 0 0;
    color: var(--auth-muted);
    font-size: .88rem;
    line-height: 1.5;
}

.auth-form {
    display: grid;
    gap: 17px;
}

.auth-field { min-width: 0; }

.auth-field > label,
.auth-label-row label {
    display: block;
    margin-bottom: 7px;
    color: #293b49;
    font-size: .8rem;
    font-weight: 700;
}

.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-label-row a {
    margin-bottom: 7px;
    color: #276985;
    font-size: .75rem;
    font-weight: 650;
    text-decoration: none;
}

.auth-label-row a:hover,
.auth-switch a:hover { text-decoration: underline; }

.auth-input-wrap {
    display: flex;
    min-height: 48px;
    align-items: center;
    border: 1px solid var(--auth-border);
    border-radius: 9px;
    background: #fff;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-input-wrap:focus-within {
    border-color: #4d829d;
    box-shadow: 0 0 0 3px var(--auth-ring);
}

.auth-input-wrap.has-error {
    border-color: #d04a3f;
    background: #fffafa;
}

.auth-input-icon {
    display: inline-flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    color: #718294;
    font-size: .82rem;
    font-weight: 800;
}

.auth-lock-icon,
.auth-person-icon { position: relative; }

.auth-lock-icon::before {
    content: "";
    width: 10px;
    height: 9px;
    border: 2px solid currentColor;
    border-radius: 3px;
}

.auth-lock-icon::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    margin-top: -10px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
}

.auth-person-icon::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-top: -9px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.auth-person-icon::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 7px;
    margin-top: 10px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}

.auth-input-wrap input {
    min-width: 0;
    width: 100%;
    height: 46px;
    padding: 0 10px 0 0;
    border: 0;
    background: transparent;
    color: var(--auth-ink);
    font-size: .92rem;
    outline: 0;
    box-shadow: none;
}

.auth-input-wrap input::placeholder { color: #98a5b1; }

.auth-password-toggle {
    align-self: stretch;
    min-width: 52px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #52677a;
    font-size: .7rem;
    font-weight: 750;
    cursor: pointer;
}

.auth-password-toggle:hover {
    background: var(--auth-soft);
    color: var(--auth-ink);
}

.auth-password-toggle:focus-visible,
.auth-submit:focus-visible,
.auth-switch a:focus-visible,
.auth-label-row a:focus-visible,
.auth-brand:focus-visible,
.auth-check:focus-within {
    outline: 3px solid var(--auth-ring);
    outline-offset: 2px;
}

.auth-field-error {
    margin: 6px 0 0;
    color: var(--auth-danger);
    font-size: .75rem;
    line-height: 1.4;
}

.auth-check {
    display: inline-flex;
    width: fit-content;
    min-height: 36px;
    align-items: center;
    gap: 9px;
    color: #435567;
    font-size: .79rem;
    cursor: pointer;
}

.auth-check input {
    width: 17px;
    height: 17px;
    border-color: #a8b5c0;
    border-radius: 4px;
    color: var(--auth-primary);
}

.auth-submit {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    background: var(--auth-primary);
    color: #fff;
    font-size: .86rem;
    font-weight: 750;
    cursor: pointer;
    transition: background-color 160ms ease;
}

.auth-submit:hover { background: var(--auth-primary-hover); }
.auth-submit:disabled { cursor: wait; opacity: .7; }

.auth-switch {
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid #e5eaee;
    color: var(--auth-muted);
    font-size: .8rem;
    text-align: center;
}

.auth-switch a {
    color: #1f627e;
    font-weight: 750;
    text-decoration: none;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: -6px 0 18px;
    padding: 11px 12px;
    border: 1px solid;
    border-radius: 9px;
    font-size: .78rem;
    line-height: 1.45;
}

.auth-alert-error { border-color: #fecaca; background: #fff5f5; color: #9f251b; }
.auth-alert-success { border-color: #b7e4ce; background: #effaf4; color: #176b43; }

.auth-alert-icon,
.auth-approval-icon {
    display: inline-flex;
    flex: 0 0 21px;
    width: 21px;
    height: 21px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
}

.auth-alert-error .auth-alert-icon { background: #b42318; }
.auth-alert-success .auth-alert-icon { background: #178258; }

.auth-approval-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #52677a;
}

.auth-approval-note p {
    margin: 1px 0 0;
    color: inherit;
    font-size: .74rem;
    line-height: 1.45;
}

.auth-approval-icon { background: #647b8d; }

@media (max-width: 520px) {
    .auth-main { justify-content: flex-start; padding: 22px 12px; }
    .auth-card { padding: 25px 20px; border-radius: 12px; }
    .auth-input-wrap input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-input-wrap,
    .auth-password-toggle,
    .auth-submit { transition: none !important; }
}
