/* Estilos compartidos de las pantallas publicas de autenticacion
   (Login, ForgotPassword, ResetPassword). Extraido del <style> que
   originalmente vivia solo en Views/Account/Login.cshtml, para no
   duplicarlo en cada pantalla nueva. Sin cambios visuales: mismo CSS,
   ahora reutilizable desde _LayoutAuth. */

:root {
    --appmf-primary: #2563eb;
    --appmf-primary-dark: #1d4ed8;
    --appmf-dark: #0f172a;
    --appmf-cyan: #06b6d4;
    --appmf-text-muted: #64748b;
    --appmf-border: rgba(15, 23, 42, .08);
}

html, body {
    height: 100%;
}

body.appmf-auth-body {
    margin: 0;
    font-family: var(--bs-body-font-family, system-ui, sans-serif);
}

.appmf-auth-shell {
    min-height: 100vh;
    display: flex;
}

/* ---------------------------------------------------------
   PANEL IZQUIERDO
   --------------------------------------------------------- */
.appmf-auth-side {
    position: relative;
    flex: 1 1 46%;
    overflow: hidden;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--appmf-dark) 0%, #1e3a6e 55%, var(--appmf-primary) 100%);
    color: #fff;
    padding: 3rem;
}

.appmf-auth-side-shape {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: .55;
}

.appmf-shape-1 {
    width: 320px;
    height: 320px;
    top: -80px;
    right: -60px;
    background: radial-gradient(circle, rgba(6, 182, 212, .35), transparent 70%);
}

.appmf-shape-2 {
    width: 260px;
    height: 260px;
    bottom: -80px;
    left: -60px;
    background: radial-gradient(circle, rgba(37, 99, 235, .35), transparent 70%);
}

.appmf-auth-side-content {
    position: relative;
    z-index: 1;
    max-width: 460px;
    margin: 0 auto;
}

.appmf-auth-brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-weight: 800;
    font-size: 1.15rem;
    color: #fff;
    text-decoration: none;
    margin-bottom: 3rem;
}

.appmf-auth-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.appmf-auth-side-text h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -.01em;
}

.appmf-auth-side-text p {
    color: rgba(255, 255, 255, .82);
    font-size: 1.02rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.appmf-auth-tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.appmf-auth-tag {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    padding: .45rem .85rem;
    font-size: .86rem;
    font-weight: 600;
}

/* ---------------------------------------------------------
   PANEL DERECHO
   --------------------------------------------------------- */
.appmf-auth-main {
    flex: 1 1 54%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: #f8fafc;
}

.appmf-auth-card {
    width: 100%;
    max-width: 420px;
}

.appmf-auth-tenant {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .9rem 1rem;
    background: #fff;
    border: 1px solid var(--appmf-border);
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
}

.appmf-auth-tenant img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    padding: 4px;
    flex-shrink: 0;
}

.appmf-auth-tenant-fallback {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: rgba(37, 99, 235, .08);
    color: var(--appmf-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.appmf-auth-tenant-label {
    font-size: .76rem;
    color: var(--appmf-text-muted);
    font-weight: 600;
}

.appmf-auth-tenant-name {
    font-weight: 700;
    color: var(--appmf-dark);
    font-size: .96rem;
}

.appmf-auth-tenant-type {
    font-size: .78rem;
    color: var(--appmf-text-muted);
}

.appmf-auth-role-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: .45rem;
    padding: .22rem .65rem;
    border: 1.5px solid var(--appmf-primary);
    border-radius: 999px;
    background: rgba(37, 99, 235, .06);
    color: var(--appmf-primary-dark);
    font-size: .74rem;
    font-weight: 700;
}

.appmf-auth-role-chip i {
    font-size: .8rem;
}

.appmf-auth-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(37, 99, 235, .08);
    color: var(--appmf-primary);
    border: 1px solid rgba(37, 99, 235, .16);
    border-radius: 999px;
    padding: .35rem .75rem;
    font-size: .78rem;
    font-weight: 700;
}

.appmf-auth-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--appmf-dark);
    margin-bottom: .35rem;
}

.appmf-auth-subtitle {
    color: var(--appmf-text-muted);
    font-size: .95rem;
}

.appmf-auth-alert {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 12px;
    padding: .8rem 1rem;
    font-size: .88rem;
}

.appmf-auth-alert-success {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    border-radius: 12px;
    padding: .8rem 1rem;
    font-size: .88rem;
}

.appmf-auth-label {
    display: block;
    font-size: .82rem;
    font-weight: 700;
    color: var(--appmf-dark);
    margin-bottom: .4rem;
}

.appmf-auth-input-group {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: #fff;
    border: 1px solid var(--appmf-border);
    border-radius: 12px;
    padding: .15rem .9rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}

    .appmf-auth-input-group:focus-within {
        border-color: var(--appmf-primary);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    }

    .appmf-auth-input-group i {
        color: var(--appmf-text-muted);
        font-size: .95rem;
    }

.appmf-auth-input {
    flex: 1;
    border: none;
    outline: none;
    padding: .65rem 0;
    font-size: .95rem;
    color: var(--appmf-dark);
    background: transparent;
}

.appmf-auth-error {
    color: #dc2626;
    font-size: .8rem;
    display: block;
    margin-top: .3rem;
    font-weight: 650;
}

.appmf-auth-forgot {
    font-size: .8rem;
    font-weight: 700;
    color: var(--appmf-primary);
    text-decoration: none;
    white-space: nowrap;
}

.appmf-auth-forgot:hover {
    text-decoration: underline;
    color: var(--appmf-primary-dark);
}

.appmf-auth-tenant--soft {
    background: linear-gradient(135deg, #eff6ff, #ffffff);
    border-color: rgba(37, 99, 235, .16);
}

.appmf-auth-toggle-pass {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--appmf-text-muted);
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background .15s ease, color .15s ease;
}

.appmf-auth-toggle-pass:hover {
    background: rgba(15, 23, 42, .06);
    color: var(--appmf-dark);
}

.appmf-auth-toggle-pass[aria-pressed="true"] {
    color: var(--appmf-primary);
}

.appmf-auth-remember .form-check-label {
    font-size: .88rem;
    color: var(--appmf-text-muted);
}

.appmf-auth-submit {
    width: 100%;
    background: var(--appmf-primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: .8rem 1rem;
    font-weight: 700;
    font-size: .98rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .25);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
}

    .appmf-auth-submit:hover:not(:disabled) {
        background: var(--appmf-primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 16px 30px rgba(37, 99, 235, .30);
    }

    .appmf-auth-submit:disabled,
    .appmf-auth-submit.is-busy {
        opacity: .9;
        cursor: wait;
        transform: none;
    }

.appmf-auth-spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    animation: appmf-auth-spin .7s linear infinite;
    flex: 0 0 auto;
}

@keyframes appmf-auth-spin {
    to { transform: rotate(360deg); }
}

.appmf-auth-footer-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: .88rem;
}

    .appmf-auth-footer-link a {
        color: var(--appmf-text-muted);
        text-decoration: none;
        font-weight: 600;
    }

        .appmf-auth-footer-link a:hover {
            color: var(--appmf-primary);
        }

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 880px) {
    .appmf-auth-shell {
        flex-direction: column;
    }

    .appmf-auth-side {
        flex: 0 0 auto;
        padding: 1.75rem 1.35rem 1.5rem;
        min-height: auto;
    }

    .appmf-auth-side-content {
        max-width: none;
    }

    .appmf-auth-brand {
        margin-bottom: 1.25rem;
    }

    .appmf-auth-side-text h1 {
        font-size: 1.4rem;
        margin-bottom: .55rem;
    }

    .appmf-auth-side-text p {
        font-size: .95rem;
        margin-bottom: 1rem;
    }

    .appmf-auth-main {
        flex: 1;
        padding: 1.5rem 1.15rem 2rem;
        align-items: flex-start;
    }

    .appmf-auth-card {
        max-width: 480px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .appmf-auth-submit,
    .appmf-auth-spinner {
        transition: none;
        animation: none;
    }
}
