/* Auth pages - login, signup. Copied from a reference implementation's
   auth.css and kept structurally as-is (reuse the clean layout). Dropped:
   chromed-nav variant, OAuth buttons/divider, MFA input (none of those exist
   in asondy's backend/frontend yet). .auth-btn now fills with --primary
   (solid-fill token) instead of --accent (text/link tint), per web/DESIGN.md. */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4rem 2rem 2rem;
    background: var(--bg);
}

.auth-container {
    width: 100%;
    max-width: 24rem;
}

.auth-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 2rem;
}

.auth-logo {
    text-decoration: none;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--dim);
    font-size: 14px;
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-context {
    color: var(--dim);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-trust {
    margin-top: 1rem;
    margin-bottom: 0;
}

.auth-trust a {
    color: var(--accent);
    text-decoration: none;
}

.auth-trust a:hover {
    text-decoration: underline;
}

/* OAuth: outline buttons, neutral (not accent-colored) so 3 provider marks
   read clearly. Shown directly on both login.html and signup.html - no
   collapsed disclosure. */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    height: 2.5rem;
    padding: 0 1.25rem;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.oauth-btn:hover {
    border-color: var(--dim);
    background: var(--bg);
}

.oauth-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--dim);
    font-size: 12px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* Honest status note under the OAuth section - not hidden in a report. */
.oauth-note {
    font-size: 12px;
    color: var(--dim);
    text-align: center;
    margin-top: -0.75rem;
    margin-bottom: 1.25rem;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 14px;
    color: var(--dim);
}

.form-group input {
    height: auto;
    padding: 0.75rem 1.25rem;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill) !important;
    color: var(--text);
    transition: border-color 0.15s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input::placeholder {
    color: var(--dim);
}

.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--bg) inset !important;
    box-shadow: 0 0 0 1000px var(--bg) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-hint {
    font-size: 12px;
    color: var(--dim);
}

/* Password toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    width: 100%;
    padding-right: 2.5rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--dim);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
}

.password-toggle:hover {
    color: var(--text);
}

/* Links */
.forgot-link {
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    text-align: right;
}

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

/* Submit button: solid fill uses --primary (web/DESIGN.md: "Solid fills only:
   buttons, dots, badges"), not --accent (text/icon/link tint). */
.auth-btn {
    height: 2.5rem;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--radius-pill);
    color: #fff;
    cursor: pointer;
    transition: opacity 0.15s ease;
    margin-top: 0.5rem;
}

.auth-btn:hover {
    opacity: 0.9;
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--dim);
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Error messages: hidden until JS sets style.display = 'block' on show */
.error-message {
    display: none;
    background: rgba(229, 96, 94, 0.1);
    border: 1px solid var(--red);
    border-radius: var(--radius-card);
    color: var(--red);
    padding: 0.75rem;
    font-size: 14px;
    margin-bottom: 1rem;
}

.success-message {
    display: none;
    background: rgba(30, 138, 95, 0.1);
    border: 1px solid var(--green);
    border-radius: var(--radius-card);
    color: var(--green);
    padding: 0.75rem;
    font-size: 14px;
    margin-bottom: 1rem;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
    .auth-page {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
        border-radius: var(--radius-card);
    }
}

/* Auth header row - back link */
.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
    color: var(--dim);
    text-decoration: none;
}

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

.auth-back svg {
    width: 14px;
    height: 14px;
}

/* Password Requirements Checker */
.password-requirements {
    display: none;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    font-size: 12px;
}

.password-requirements.visible {
    display: block;
}

.password-requirements ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dim);
    transition: color 0.15s ease;
}

.password-requirements li::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 1px solid var(--dim);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.password-requirements li.valid {
    color: var(--green);
}

.password-requirements li.valid::before {
    border-color: var(--green);
    background: var(--green);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}
