/* ==========================================================================
   Login diocesano — "wow" en tono suave: tarjeta elevada con animación de
   entrada, escudo y botón con degradado, sobre FONDO CLARO (azul solo de toque).
   Acotado a .com-users-login y cargado DESPUÉS de material-dashboard.min.css.
   ========================================================================== */

/* ---- Fondo claro con un toque azul (no invasivo) ---- */
body.view-login,
.view-login {
    min-height: 100vh;
    background: radial-gradient(900px 420px at 50% -8%, rgba(0, 74, 173, .12) 0%, rgba(0, 74, 173, 0) 60%),
                linear-gradient(160deg, #f4f7fb 0%, #e7eef8 100%) !important;
    background-attachment: fixed !important;
}

/* Escudo como marca de agua MUY tenue de fondo. */
body.view-login::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("/images/logo_archimadrid_escudo.png") center 18% / min(38vh, 340px) no-repeat;
    opacity: .045;
    pointer-events: none;
    z-index: 0;
}

/* Login ENFOCADO: ocultar cabecera/menú/pie del sitio (evita branding duplicado) y
   centrar la tarjeta en pantalla. Solo en la vista de login. */
body.view-login #sp-header,
body.view-login #sp-menu,
body.view-login #sp-top-bar,
body.view-login #sp-footer,
body.view-login #sp-bottom,
body.view-login .sp-page-title,
body.view-login .breadcrumb,
body.view-login #sp-top-bar { display: none !important; }

body.view-login #sp-main,
body.view-login .body-innerwrapper,
body.view-login .body-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* ---- Contenedor ---- */
.com-users-login {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin: 4rem auto;
    padding: 0 1rem;
}

.com-users-login .row { margin-inline: 0; }
.com-users-login .col-lg-4 {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    padding-inline: 0;
}

/* ---- Tarjeta ---- */
.com-users-login__form {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 20px;
    padding: 2.4rem 1.9rem 2rem;
    box-shadow: 0 20px 50px rgba(1, 26, 71, .14), 0 2px 8px rgba(1, 26, 71, .06);
    min-height: 0;
    animation: sm-login-in .55s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes sm-login-in {
    from { opacity: 0; transform: translateY(20px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

/* Escudo en disco blanco, superpuesto al borde superior de la tarjeta. */
.com-users-login__form::before {
    content: "";
    order: -2;
    width: 108px;
    height: 108px;
    margin: -4.6rem auto 1rem;
    border-radius: 50%;
    background: #fff url("/images/logo_archimadrid_escudo.png") center 46% / 76% no-repeat;
    box-shadow: 0 14px 30px rgba(1, 26, 71, .24);
    border: 1px solid rgba(1, 45, 107, .08);
}

/* Título bajo el escudo. */
.com-users-login__form::after {
    content: "Plataforma Sacramental";
    order: -1;
    margin: -.3rem 0 1.4rem;
    text-align: center;
    font: 800 1.15rem/1.2 system-ui, "Segoe UI", Arial, sans-serif;
    letter-spacing: .3px;
    color: #012d6b;
}

/* ---- Campos ---- */
.com-users-login__form label {
    display: block;
    font-weight: 600;
    margin-bottom: .4rem;
    color: #1f2937;
}

.com-users-login__form .form-control,
.com-users-login__form input[type="text"],
.com-users-login__form input[type="password"],
.com-users-login__form input[type="email"] {
    width: 100% !important;
    height: auto !important;
    padding: .7rem .85rem !important;
    font-size: 1rem !important;
    line-height: 1.4 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #111827 !important;
    box-shadow: none !important;
    background-image: none !important;
    transition: border-color .15s, box-shadow .15s;
}

.com-users-login__form .form-control:focus,
.com-users-login__form input:focus {
    border-color: #004aad !important;
    box-shadow: 0 0 0 4px rgba(0, 74, 173, .18) !important;
    outline: none !important;
}

/* ---- Botón principal con degradado y elevación ---- */
.com-users-login__form .btn-primary {
    width: 100%;
    padding: .8rem 1rem !important;
    border: 0 !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    letter-spacing: .3px;
    color: #fff !important;
    background: linear-gradient(135deg, #0059d1 0%, #003a86 100%) !important;
    box-shadow: 0 10px 24px rgba(0, 74, 173, .35) !important;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.com-users-login__form .btn-primary:hover,
.com-users-login__form .btn-primary:focus {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(0, 74, 173, .45) !important;
    filter: brightness(1.05);
}
.com-users-login__form .btn-primary:active { transform: translateY(0); }

.com-users-login__form .btn-secondary {
    width: 100%;
    border-radius: 12px !important;
    padding: .65rem 1rem !important;
    font-weight: 600 !important;
}

/* "Recordarme". */
.com-users-login__remember .form-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .25rem 0 .9rem;
}
.com-users-login__remember .form-check-input { margin: 0; }

/* Enlaces inferiores. */
.com-users-login__options {
    margin-top: 1.4rem;
    border: 0;
}
.com-users-login__options .list-group-item {
    border: 0 !important;
    padding: .4rem 0 !important;
    background: transparent !important;
    text-align: center;
    color: #004aad;
    font-weight: 600;
    transition: color .15s;
}
.com-users-login__options .list-group-item:hover { color: #012d6b; }
.com-users-login__options .list-group-item + .list-group-item { border-top: 1px solid #eef2f7 !important; }

.com-users-login__description { margin-bottom: 1rem; text-align: center; }
.com-users-login__image { max-width: 100%; height: auto; }

/* ---- Contraseña con botón de "ojo": en línea, no barra gris a lo ancho ---- */
.com-users-login__form .input-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
}
.com-users-login__form .input-group > .form-control,
.com-users-login__form .input-group > input {
    width: auto !important;
    flex: 1 1 auto !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.com-users-login__form .input-group > .btn,
.com-users-login__form .input-group > button,
.com-users-login__form .input-group-text {
    flex: 0 0 auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 .9rem !important;
    border: 1px solid #cbd5e1 !important;
    border-left: 0 !important;
    border-radius: 0 12px 12px 0 !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    box-shadow: none !important;
}

/* ---- Botón "passkey": outline discreto (en vez del gris macizo) ---- */
.com-users-login__form .btn-secondary {
    background: #fff !important;
    color: #004aad !important;
    border: 1.5px solid #d3dced !important;
    box-shadow: none !important;
}
.com-users-login__form .btn-secondary:hover,
.com-users-login__form .btn-secondary:focus {
    border-color: #004aad !important;
    background: #f4f8ff !important;
}

/* Aprieta la tarjeta (menos aire muerto abajo). */
.com-users-login__form { padding-bottom: 1.6rem; }
.com-users-login__form .mb-3 { margin-bottom: 1rem !important; }

/* ---- Responsive ---- */
@media (max-width: 576px) {
    .com-users-login { margin: 2.5rem auto; }
    .com-users-login__form { padding: 2rem 1.2rem 1.6rem; border-radius: 16px; }
    .com-users-login__form::before { width: 84px; height: 84px; margin-top: -3.4rem; }
}

/* ---- Accesibilidad ---- */
@media (prefers-reduced-motion: reduce) {
    .com-users-login__form { animation: none; }
    .com-users-login__form .btn-primary { transition: none; }
}
