/* auth-forms.css
   Plain-CSS support for Login.cshtml and ForgotPassword.cshtml. These pages
   used to rely on Tailwind utility classes (served via the sitewide CDN
   script in _Layout.cshtml); this file replaces that dependency for the
   pieces that are specific to these two pages. Shared brand button/link
   styles (.btn-brand, .text-brand-link) live in register-flow.css and are
   reused here rather than duplicated. */

.card-header-brand {
    background-color: #16a34a;
    color: #fff;
}

/* Focus ring: solid 2px brand-green, the same as the old Tailwind
   focus:ring-2 focus:ring-green-600 (Bootstrap's default is a soft blue). */
.form-control:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px #16a34a;
    outline: none;
}

/* Manual invalid-field highlight, toggled by the Login page's client-side
   validation JS (equivalent to the old Tailwind border-red-500). */
.field-invalid {
    border-color: #ef4444 !important;
}

/* ---- Tooltip-on-focus field hints (Login.cshtml) ---- */

.tooltip-wrapper {
    position: relative;
    width: 100%;
}

.tooltip {
    display: none;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: -80px;
    left: 0;
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    max-width: 250px;
    z-index: 99999;
    overflow-wrap: break-word;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px;
    border: 6px solid transparent;
    border-top-color: #333;
}

.tooltip-wrapper > input:focus + .tooltip,
.tooltip-wrapper > span:hover + .tooltip {
    display: block;
    visibility: visible;
    opacity: 1;
}

@media (max-width: 640px) {
    .tooltip {
        font-size: 12px;
        max-width: 200px;
        padding: 6px 10px;
        top: -60px;
    }

    .tooltip::after {
        border-width: 5px;
        left: 15px;
    }
}

/* ---- Loading overlay + spinner (Login.cshtml) ---- */

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: auth-spin 1s linear infinite;
}

@keyframes auth-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Keep alert boxes visible regardless of any conflicting page CSS */
.alert,
.alert-success,
.alert-danger,
.alert-warning {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin-bottom: 1rem;
}

/* ---- Login page layout (Login.cshtml) ----
   Plain-CSS equivalents of the Tailwind utilities the page originally used,
   so the look matches the pre-migration page: grey page background, a
   500px-max card, bolder/larger header, roomier inputs, medium-weight labels.
   All classes are .auth-* prefixed and only used on the pages that load
   this stylesheet. */

.auth-page-section {
    background-color: #f9fafb;          /* bg-gray-50 */
    padding: 3rem 0;                    /* py-12 */
}

.auth-page-section > .container {
    padding-left: 1rem;                 /* px-4 */
    padding-right: 1rem;
}

/* The focus tooltips sit above the inputs; don't let any ancestor clip them. */
.auth-page-section,
.auth-page-section .container,
.auth-card-body,
.auth-page-section form {
    overflow: visible !important;
    position: relative;
}

.auth-card {
    border-radius: 0.5rem;
}

.card-header.card-header-brand {
    padding: 1rem;
}

.auth-card-title {
    margin: 0;
    font-size: 1.25rem;                 /* text-xl */
    line-height: 1.75rem;
    font-weight: 600;                   /* font-semibold */
    text-align: center;
}

.auth-card-body {
    padding: 1.5rem;                    /* p-6 */
}

.auth-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;                          /* gap-4 */
    margin-bottom: 1rem;                /* mb-4 */
}

.auth-label {
    display: block;
    margin-bottom: 0.5rem;              /* mb-2 */
    color: #374151;                     /* text-gray-700 */
    font-weight: 500;                   /* font-medium */
}

.form-control.auth-input {
    width: 100%;
    padding: 0.75rem;                   /* p-3 */
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;              /* rounded-lg */
}

.form-control.auth-input:focus {
    border-color: #16a34a;
}

.auth-error {
    color: #ef4444;                     /* text-red-500 */
    font-size: 0.875rem;                /* text-sm */
}

.field-validation-error {
    display: block;
    margin-top: 4px;
}

/* Brand button, sized like the original inline Log in button. */
.btn-brand.auth-submit {
    display: inline-block;
    width: auto;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;      /* matches Bootstrap .btn box size */
    font-weight: 500;                   /* font-medium */
}
