/* auth.css — shared styling for the Account/Pages auth family (Login,
   ForgotPassword's OTP/reset wizard, and future pages in the same shell).
   Global (not Blazor-scoped) on purpose: these pages each get their own
   [ExcludeFromInteractiveRouting] scoped .razor.css today, which meant this
   set of "auth-*" classes had to be copy-pasted per page. Centralizing here
   avoids that duplication as the auth-page family grows.

   Colors read var(--accent-from)/var(--accent-to), which LoginLayout.razor.css
   defines on the real ancestor .auth-shell element (so they inherit normally
   regardless of which stylesheet/component scope references them). */

.auth-header {
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: #9aa1c2;
    margin-top: 0.35rem;
}

.auth-alert,
.auth-info {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    animation: auth-alert-in 0.25s ease both;
}

.auth-alert {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #ff9a9a;
}

.auth-info {
    background: color-mix(in srgb, var(--accent-from, #4f6ef7) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-from, #4f6ef7) 40%, transparent);
    color: #c3cdff;
}

@keyframes auth-alert-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-field {
    margin-bottom: 1.35rem;
}

.auth-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.auth-field-head label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #dde0f0;
}

.auth-forgot-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-from, #8fa0ff);
    text-decoration: none;
}

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

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

.auth-input-wrap .form-control {
    width: 100%;
    height: 3rem;
    border-radius: 11px;
    border: 1px solid transparent;
    background: #eef0f8;
    color: #14172a;
    padding: 0 2.6rem 0 1rem;
    font-size: 0.92rem;
}

.auth-input-wrap .form-control::placeholder {
    color: #8a8fa3;
}

.auth-input-wrap .form-control:focus {
    outline: none;
    border-color: var(--accent-from, #4f6ef7);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-from, #4f6ef7) 25%, transparent);
}

.auth-input-wrap .field-icon-end {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #7a8095;
    font-size: 0.85rem;
    pointer-events: none;
}

.auth-input-wrap button.password-toggle-btn {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #7a8095;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.auth-input-wrap button.password-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #4a4f63;
}

.text-danger.validation-message {
    display: block;
    font-size: 0.78rem;
    margin-top: 0.3rem;
    color: #ff9a9a !important;
}

.auth-row {
    display: flex;
    align-items: center;
    margin: 0.25rem 0 1.4rem 0;
}

.btn-auth {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-from, #4f6ef7) 0%, var(--accent-to, #7c3aed) 100%);
    box-shadow: 0 14px 26px -12px rgba(79, 70, 229, 0.65);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-auth:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px -12px rgba(79, 70, 229, 0.75);
}

.btn-auth:active:not(:disabled) {
    transform: translateY(0);
}

.btn-auth + .btn-auth {
    margin-top: 0.6rem;
}

/* Secondary, low-emphasis submit control rendered as a button but styled as
   a text link — used for "Resend code" / "Use a different email" actions
   that are still real form submits (need [SupplyParameterFromForm] to see
   which one was pressed), just not the primary action. */
.auth-link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-from, #8fa0ff);
    cursor: pointer;
}

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

.auth-links {
    margin-top: 1.1rem;
    text-align: center;
    font-size: 0.85rem;
}

.auth-links a {
    color: var(--accent-from, #8fa0ff);
    text-decoration: none;
}

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

.auth-trust-note {
    text-align: center;
    font-size: 0.78rem;
    color: #6d7391;
    margin-top: 1.1rem;
}

.auth-trust-note i {
    margin-right: 0.3rem;
}

/* ── Submit-in-progress state (see js/Common.js: handleAuthFormSubmit) ── */
.btn-auth.is-loading {
    color: transparent !important;
    pointer-events: none;
    position: relative;
}

.btn-auth.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-auth-spin 0.7s linear infinite;
}

.auth-link-btn.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

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