* {
    box-sizing: border-box;
}

body.login-page {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #eef2f7;
    color: #1f2937;
    font: 16px "Segoe UI", Arial, sans-serif;
}

.login-card {
    width: min(92%, 390px);
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 15px 40px #0002;
}

.modal-title {
    margin-bottom: 22px;
    color: #1e3a8a;
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
}

.intro {
    margin: -8px 0 20px;
    color: #64748b;
    text-align: center;
}

.field {
    display: grid;
    gap: 6px;
    margin: 15px 0;
}

.field input,
.login-button,
.secondary {
    padding: 12px;
    border-radius: 7px;
    font: inherit;
}

.otp-box {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    background: #f0fdf4;
}

.otp-explanation {
    margin: 0 0 12px;
    color: #166534;
    font-size: .85rem;
    line-height: 1.4;
}

.trusted-device-option {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    max-width: 100%;
    margin: 10px 0;
    font-size: clamp(.78rem, 3.5vw, .9rem);
    white-space: nowrap;
}

.trusted-device-option input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
}

.emergency-link {
    display: block;
    width: 100%;
    margin-top: 15px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 500;
    text-align: center;
}

.emergency-link:hover {
    text-decoration: underline;
}

button[aria-disabled="true"] {
    pointer-events: none;
}

.field input {
    width: 100%;
    border: 1px solid #cbd5e1;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    width: 100%;
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 5px;
    width: 38px;
    padding: 7px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #334155;
    cursor: pointer;
}

.login-button,
.secondary {
    width: 100%;
    border: 0;
    cursor: pointer;
    font-weight: 700;
}

.login-button {
    background: #2563eb;
    color: #fff;
}

.secondary {
    background: transparent;
    color: #2563eb;
}

.link {
    display: block;
    margin-top: 15px;
    color: #2563eb;
    text-align: center;
}

.error,
.notice {
    padding: 11px;
    border-radius: 6px;
}

.error {
    background: #fee2e2;
    color: #991b1b;
}

.notice {
    background: #dbeafe;
    color: #1e40af;
}

.freeze-overlay {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffffe8;
    cursor: wait;
}

.freeze-overlay.is-active {
    display: flex;
}

.spinner {
    width: 42px;
    height: 42px;
    margin-bottom: 15px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.freeze-text {
    color: #1e3a8a;
    font-weight: 700;
}

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

