* {
    box-sizing: border-box;
}

body.auth-page {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 24px 16px;
    background: #eaeaea;
    color: #333;
    font-family: Arial, sans-serif;
}

.auth-card {
    width: min(100%, 360px);
    padding: 40px 30px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.auth-card h1 {
    margin: 0 0 25px;
    color: #333;
    font-size: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.auth-form label {
    margin-bottom: 5px;
    color: #444;
    font-size: 15px;
    text-align: left;
}

.auth-form input {
    width: 100%;
    margin: 0 0 15px;
    padding: 12px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
}

.auth-form input:focus-visible,
.auth-form button:focus-visible,
.auth-card a:focus-visible {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}

.auth-form button {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border: 0;
    border-radius: 4px;
    background: #007bff;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.auth-form button:hover {
    background: #0056b3;
}

.auth-form button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.auth-form .secondary-buttons {
    margin-top: 10px;
}

.auth-form .secondary-buttons button {
    background: #6c757d;
}

.auth-form .secondary-buttons button:hover {
    background: #5a6268;
}

.auth-message {
    margin: 15px 0 0;
    color: #28a745;
    font-size: 15px;
}

.auth-error {
    min-height: 20px;
    margin-top: 10px;
    color: #d32f2f;
    font-size: 15px;
}

.auth-card a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-card a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.auth-links {
    margin: 15px 0 0;
}

.auth-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    margin-bottom: 18px;
    border: 6px solid #f3f3f3;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: auth-spin 1s linear infinite;
}

.loading-text {
    color: #333;
    font-size: 18px;
}

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

@media (max-width: 400px) {
    .auth-card {
        padding: 28px 20px;
    }
}

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