/* Sign-in screen. Loads after admin.css and reuses its tokens. */

body.auth-body { background: var(--bg); }

.auth {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: var(--space-4);
}

/* ---------- Form column ---------- */

.auth__main { width: 100%; max-width: 388px; }

.auth__card {
    padding: var(--space-5) var(--space-4);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
}

.auth__logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    font-size: 15px;
    font-weight: 600;
}

.auth__title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.auth__sub { margin: 6px 0 var(--space-4); font-size: 14px; color: var(--muted-fg); }

.field { margin-bottom: var(--space-3); }

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

.field__control { position: relative; display: flex; align-items: center; }

.field input {
    width: 100%;
    min-height: 44px;
    padding: 0 var(--space-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--card);
    color: var(--fg);
    font: inherit;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field input::placeholder { color: #94a3b8; }

.field input:hover { border-color: #cbd5e1; }

.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, .15);
}

.field input[type=password],
.field input[data-reveal] { padding-right: 46px; }

.field--invalid input { border-color: var(--danger); }
.field--invalid input:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .14); }

.reveal {
    position: absolute;
    right: 4px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted-fg);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.reveal:hover { background: var(--muted); color: var(--fg); }
.reveal svg { width: 17px; height: 17px; }

.auth__alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-1);
    margin: 0 0 var(--space-3);
    padding: var(--space-2);
    border: 1px solid #f5c8c8;
    border-radius: 9px;
    background: #fdeaea;
    color: #991b1b;
    font-size: 13px;
}

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

.btn--block { width: 100%; justify-content: center; min-height: 44px; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }

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

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

.auth__foot {
    margin: var(--space-4) 0 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted-fg);
    text-align: center;
}

.auth__hint {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    margin-top: var(--space-2);
    font-size: 12px;
    color: var(--muted-fg);
}
.auth__hint svg { width: 13px; height: 13px; }

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
    .auth { padding: var(--space-3); align-items: start; padding-top: 8vh; }
    .auth__card { padding: var(--space-4) var(--space-3); }
}

@media (prefers-reduced-motion: reduce) {
    .spinner { animation: none; }
}
