/* ============================================================
   auth.css — Sistema visual compartido de Login y Registro.
   Se carga solo en esas dos vistas vía @push('css'), así que
   no afecta al resto del sitio.
   Cada blade conserva únicamente su estrategia de alto
   (.auth-main fijo en login / fluido en registro).
   Reglas muertas eliminadas en la auditoría:
   - padding/margin en .bg-azul (los cubre la fila g-0 + el reset)
   - reglas .alert (el parcial solo dispara toasts, nunca pinta .alert)
   ============================================================ */

/* Lado del banner: fondo blanco, pegado a la izquierda (eje X),
   centrado vertical (eje Y). Solo visible en pantallas grandes. */
.bg-azul {
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.bg-azul img {
    width: 100%;
    max-width: 600px;
    max-height: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.auth-main .bg-azul img {
    max-height: calc(100vh - var(--nav-h, 64px));
}

/* Columna del formulario: fondo blanco puro. */
.login-side,
.register-side {
    background-color: #ffffff;
    padding: 1rem 1.5rem;
    align-items: flex-start;
    overflow-x: hidden;
}

/* Envoltorio centrado con margin auto: centra cuando hay espacio
   y se ancla arriba con scroll si el contenido supera el alto. */
.login-inner,
.register-inner {
    width: 100%;
    max-width: 380px;
    margin: auto;
}

/* Tarjeta (solo difiere el padding entre login y registro). */
.login-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f2;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(15, 35, 80, 0.10), 0 1px 3px rgba(15, 35, 80, 0.06);
    padding: 0.9rem 1.25rem 0.8rem;
    width: 100%;
    max-width: 380px;
    position: relative;
    overflow: hidden;
}

.register-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f2;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(15, 35, 80, 0.10), 0 1px 3px rgba(15, 35, 80, 0.06);
    padding: 0.85rem 1.1rem 0.75rem;
    width: 100%;
    max-width: 380px;
    position: relative;
    overflow: hidden;
}

/* Barra superior de acento de la tarjeta. */
.login-card::before,
.register-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0d6efd 0%, #00b4ff 55%, #0d6efd 100%);
}

/* Encabezado de marca. */
.brand-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.brand-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: #eef4ff;
    border: 1px solid #dbe7ff;
    flex-shrink: 0;
}

.brand-tile img {
    width: 22px;
    height: auto;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text strong {
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    color: #0f1e3d;
}

.brand-text small {
    font-size: 0.72rem;
    color: #8a94a6;
}

.secure-dot {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #178a50;
    background: #e9f7ef;
    border: 1px solid #cdeeda;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    white-space: nowrap;
}

.welcome-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0d6efd;
    background: #e8f0fe;
    border: 1px solid #cfdefc;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.35rem;
}

.login-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f1e3d;
    margin: 0 0 0.1rem;
}

.register-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f1e3d;
    margin: 0 0 0.1rem;
}

.login-sub,
.register-sub {
    font-size: 0.8rem;
    color: #8a94a6;
    margin: 0 0 0.55rem;
}

/* Campos (el margen inferior difiere apenas entre vistas). */
.login-card .field {
    margin-bottom: 0.5rem;
}

.register-card .field {
    margin-bottom: 0.45rem;
}

.field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #33415c;
    margin-bottom: 0.3rem;
}

/* Fila etiqueta + link (solo login: "¿La olvidaste?"). */
.label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}

.label-row label {
    margin-bottom: 0;
}

.label-row a {
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
}

.label-row a:hover {
    text-decoration: underline;
}

.input-wrap {
    position: relative;
}

.input-wrap .input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa6bb;
    font-size: 0.85rem;
    pointer-events: none;
}

.login-card .form-control.login-input {
    height: 2.5rem;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    font-size: 0.88rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.register-card .form-control.register-input {
    height: 2.45rem;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    font-size: 0.86rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-card .form-control.login-input::placeholder,
.register-card .form-control.register-input::placeholder {
    color: #a5b0c2;
}

.login-card .form-control.login-input:focus,
.register-card .form-control.register-input:focus {
    background: #ffffff;
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
    outline: none;
}

/* Errores de validación del servidor (solo registro los pinta en línea). */
.register-card .text-danger {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* Ojito de contraseña: anclado verticalmente al campo con top+bottom+auto,
   así no lo mueve ni el reemplazo SVG de FontAwesome ni .field-icon global. */
.input-wrap .pwd-toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0.85rem;
    margin: auto 0;
    height: 1em;
    display: inline-flex;
    align-items: center;
    color: #9aa6bb;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    z-index: 5;
}

.input-wrap .pwd-toggle:hover {
    color: #0d6efd;
}

/* Fila recuerdo + acceso protegido (solo login). */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.1rem 0 0.5rem;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: #5b6b82;
    cursor: pointer;
    margin: 0;
}

.remember input {
    accent-color: #0d6efd;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.attempts-hint {
    font-size: 0.72rem;
    color: #9aa6bb;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Términos y condiciones (solo registro). */
.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.1rem 0 0.65rem;
    font-size: 0.78rem;
    color: #5b6b82;
}

.terms-row input {
    accent-color: #0d6efd;
    width: 15px;
    height: 15px;
    margin-top: 0.15rem;
    flex-shrink: 0;
    cursor: pointer;
}

.terms-row a {
    font-weight: 600;
    text-decoration: none;
}

.terms-row a:hover {
    text-decoration: underline;
}

/* Botón principal (solo difiere el tamaño de fuente). */
.login-card .btn-login {
    border: none;
    border-radius: 12px;
    padding: 0.55rem 1rem;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #1668dc 0%, #0b3fa8 100%);
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.register-card .btn-register-submit {
    border: none;
    border-radius: 12px;
    padding: 0.55rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #1668dc 0%, #0b3fa8 100%);
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-card .btn-login:hover,
.register-card .btn-register-submit:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(13, 110, 253, 0.4);
}

.login-card .btn-login:active,
.register-card .btn-register-submit:active {
    transform: translateY(0);
}

/* Separador + acción secundaria. */
.divider {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0.5rem 0 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: #9aa6bb;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.divider::before,
.divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: #e9edf3;
}

.btn-register,
.btn-login-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-size: 0.84rem;
    color: #0d6efd;
    background: #f2f7ff;
    border: 1.5px solid #cfdefc;
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.btn-register:hover,
.btn-login-link:hover {
    background: #e6efff;
    border-color: #0d6efd;
    color: #0b5ed7;
}

/* Tablet y móvil: solo el formulario, banner oculto. */
@media (max-width: 991.98px) {
    .bg-azul {
        display: none !important;
    }
}

/* Móvil: tarjeta a ancho completo. */
@media (max-width: 575.98px) {
    .login-card,
    .register-card {
        padding: 1rem;
        border-radius: 14px;
        box-shadow: 0 6px 14px rgba(15, 35, 80, 0.08);
        max-width: 100%;
    }
}

/* Pantallas bajas (landscape / laptops cortos): compactar tarjeta. */
@media (max-height: 720px) and (min-width: 768px) {
    .login-card {
        padding: 0.8rem 1rem;
    }

    .brand-tile {
        width: 32px;
        height: 32px;
    }

    .brand-row {
        margin-bottom: 0.4rem;
    }

    .login-card .form-control.login-input {
        height: 2.45rem;
    }

    .login-card .btn-login {
        padding: 0.48rem 1rem;
    }

    .login-title {
        font-size: 1.1rem;
    }

    .login-sub {
        margin-bottom: 0.5rem;
    }

    .login-card .field {
        margin-bottom: 0.45rem;
    }
}

@media (max-height: 720px) and (min-width: 992px) {
    .register-card {
        padding: 0.8rem 1rem;
    }

    .register-card .form-control.register-input {
        height: 2.35rem;
    }

    .register-card .btn-register-submit {
        padding: 0.48rem 1rem;
    }

    .register-title {
        font-size: 1.05rem;
    }

    .register-sub {
        margin-bottom: 0.45rem;
    }

    .register-card .field {
        margin-bottom: 0.4rem;
    }
}
