/* =======================================================================
   Auth Pages — Login, Forgot Password, Reset Password
   Shared styles for pre-authentication pages.
   ======================================================================= */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--color-darkblue);
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    overflow: auto;
}

/* ── Card ── */

.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    font-family: 'Raleway', system-ui, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    color: var(--text-heading);
    margin: 0 0 0.25rem 0;
}

.auth-card h1.auth-title-sm {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-card .powered-by {
    color: var(--text-muted);
    margin: 0 0 0.25rem 0;
    font-size: 0.75rem;
}

.auth-card .subtitle {
    color: var(--text-secondary);
    margin: 0 0 2rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ── Form controls ── */

.auth-form-group {
    margin-bottom: 1.25rem;
}

.auth-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.auth-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--input-border);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 10%, transparent);
}

/* ── Buttons ── */

.auth-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.auth-btn:hover {
    background: var(--accent-primary-hover);
}

/* ── Footer row (remember me + forgot password) ── */

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-remember input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

/* ── Links ── */

.auth-link {
    font-size: 0.875rem;
    color: var(--accent-primary);
    text-decoration: none;
}

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

.auth-back-link {
    display: inline-block;
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--accent-primary);
    text-decoration: none;
}

.auth-back-link:hover {
    text-decoration: underline;
}

/* ── Messages ── */

.auth-error {
    background: var(--color-red-10);
    border: 1px solid var(--color-red-40);
    color: var(--color-danger);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

/* ── Success state ── */

.auth-success-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
    color: var(--accent-primary);
}

.auth-success-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 0.5rem 0;
}

.auth-success-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
}

/* ── Policy list ── */

.auth-policy-list {
    margin: 0 0 1.5rem 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ── Password input with toggle ── */

.auth-password-wrap {
    position: relative;
}

.auth-password-wrap .auth-input {
    padding-right: 2.75rem;
}

/* Hide browser's native password reveal button */
.auth-password-wrap .auth-input::-ms-reveal,
.auth-password-wrap .auth-input::-webkit-credentials-auto-fill-button {
    display: none;
}

.auth-password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.auth-password-toggle:hover {
    color: var(--accent-primary);
}

.auth-password-toggle svg {
    width: 18px;
    height: 18px;
}

/* ── Loading state ── */

.auth-btn {
    position: relative;
}

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

.auth-btn-spinner {
    display: none;
}

.auth-btn.loading .auth-btn-label {
    visibility: hidden;
}

.auth-btn.loading .auth-btn-spinner {
    display: block;
    position: absolute;
    inset: 0;
    margin: auto;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.6s linear infinite;
}

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