/* Login specific overrides that align with colores y tipografía del sitio (estilosWeb.css)
   Uses CSS variables so themes can override colors per-domain (see css/login.theme.*.css)
*/

:root {
      --bg: #07070a;
      --panel: rgba(12, 12, 18, 0.86);
      --panel-border: rgba(255, 53, 94, 0.28);
      --text: #f8f8fb;
      --muted: #a7a7b8;
      --accent: #FF355E;
      --accent-soft: rgba(255, 53, 94, 0.16);
      --input: rgba(255,255,255,0.04);
    }

body {
      margin: 0;
      min-height: 100vh;
      font-family: "Segoe UI", Inter, Arial, sans-serif;
      color: var(--text);
      /*background:
        radial-gradient(circle at 20% 20%, rgba(255,53,94,0.12), transparent 28%),
        radial-gradient(circle at 80% 15%, rgba(255,53,94,0.10), transparent 24%),
        radial-gradient(circle at 70% 80%, rgba(255,53,94,0.10), transparent 26%),
        linear-gradient(180deg, #09090d 0%, #050507 100%);*/
            /* Use flex to center the login card vertically and horizontally */
            display: flex;
            align-items: center;
            justify-content: center;
            /* Allow scrolling on very small viewports */
            overflow: auto;
    }

.login-box {
    width: 100%;
    max-width: 420px;
    margin: 20px;
    box-sizing: border-box;
}

.login-card {
    /* Glassmorphism: fondo semitransparente + desenfoque */
    background: var(--panel); /* transparencia controlada por tema */
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(8px);
    padding: 30px 28px;
    border-radius: 16px; /* caja más redondeada */
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03) inset, 0 0 36px rgba(255, 53, 94, 0.12);
    border: 1px solid var(--panel-border);
    color: var(--card-text);
    text-align: center;
    position: relative; /* para pseudo-elementos */
    overflow: hidden; /* recorta la franja superior redondeada */
    /* Ajuste de ancho para que la tarjeta sea más ancha en tema default */
    width: min(440px, 92vw);
    max-width: 437px;
    margin: 20px auto;
}

/* Franja superior de color principal para dar estilo (usa variable primaria) */
.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--primary-color);
}

.login-logo {
    max-width: 200px;
    display: inline-block;
    margin-bottom: 12px;
    border-radius: 6px;
}

.login-card h1 {
    margin: 0 0 12px 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.6rem;
}

.custom-form .form-group {
    margin-bottom: 14px;
}

.custom-form .form-control {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--card-text);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    box-sizing: border-box;
}

.custom-form .form-control::placeholder {
    color: #9aa0a6;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input.form-control {
    padding-right: 2.8rem;
}

.password-wrapper .password-icon {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255,255,255,0.85);
}

.password-wrapper .password-icon:hover {
    color: #fff;
}

/* Use site primary button color (E51943) via a specific selector so it matches estilosWeb.css */
.btn-general,
.login-card button {
    display: inline-block;
    width: 100%;
    padding: 10px 14px;
    margin-top: 10px;
    height: 56px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, #ff4a70 0%, #FF355E 100%);
    color: white;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 53, 94, 0.26);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.btn-general:hover,
.login-card button:hover {
    filter: brightness(0.9);
}

.login-card a.text-muted {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    text-decoration: none;
}

.login-card a.text-muted:hover {
    text-decoration: underline;
}

.alert-danger {
  color: #721c24 !important;
  background-color: #f8d7da;
  border-color: #f5c6cb !important;
}

/* Remove aggressive autofill styles to keep inputs consistent */
input#user, input#clave {
    box-shadow: 0 0 0px 1000px #fff inset !important;
    -webkit-box-shadow: 0 0 0px 1000px #fff inset !important;
    /*-webkit-text-fill-color: #2C2C2C !important;*/
    height: 54px;
    border-radius: 16px;
    border: 1px solid #d0d0d0;
}

/* Inputs visual: fondo ligeramente más claro que la tarjeta, borde gris y texto en gris
   Esto aplica a los campos de usuario y contraseña dentro del login para que destaquen
   respecto al fondo del card y mantengan buena legibilidad. */
input#user, input#clave, .custom-form .form-control {
    background: rgba(255,255,255,0.08) !important; /* ligeramente más claro */
    border: 1px solid #d0d0d0 !important; /* borde gris diferenciador */
    color: #2C2C2C !important; /* texto en gris oscuro */
    box-shadow: none !important;
}

/* Placeholder should appear in a slightly lighter gray */
input#user::placeholder, input#clave::placeholder, .custom-form .form-control::placeholder {
    color: #9aa0a6 !important;
}

/* Mantener el icono de mostrar contraseña con contraste si el fondo cambia */
.password-wrapper .password-icon {
    color: rgba(44,44,44,0.85) !important;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .login-card { padding: 22px; }
}

@media (max-width: 480px) {
    .login-card { padding: 16px; }
    .login-card h1 { font-size: 1.3rem; }
    /* On very small screens, push the card slightly down so it isn't flush with the top */
    body { background-size: cover; background-position: top center; align-items: flex-start; padding-top: 28px; }
}

/* Decorative blurred circles in the page background using theme accent colors
     This uses a fixed pseudo-element so it doesn't affect layout and remains behind content.
     Adjusts intensity on small screens. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    /* multiple radial gradients placed around the viewport */
    background:
        radial-gradient(circle at 15% 22%, var(--accent-soft, rgba(255,53,94,0.16)) 0%, rgba(255,53,94,0.08) 12%, transparent 36%),
        radial-gradient(circle at 82% 14%, rgba(255,53,94,0.12) 0%, rgba(255,53,94,0.06) 10%, transparent 30%),
        radial-gradient(circle at 68% 76%, rgba(255,53,94,0.10) 0%, rgba(255,53,94,0.04) 12%, transparent 34%);
    filter: blur(36px);
    opacity: 0.95;
}

@media (max-width: 768px) {
    body::before {
        filter: blur(28px);
        opacity: 0.9;
        /* scale down the effect so it doesn't dominate small viewports */
        background:
            radial-gradient(circle at 12% 18%, var(--accent-soft, rgba(255,53,94,0.12)) 0%, rgba(255,53,94,0.06) 10%, transparent 32%),
            radial-gradient(circle at 82% 14%, rgba(255,53,94,0.10) 0%, rgba(255,53,94,0.04) 8%, transparent 28%);
    }
}

@media (max-width: 480px) {
    body::before {
        filter: blur(22px);
        opacity: 0.85;
        background:
            radial-gradient(circle at 10% 16%, var(--accent-soft, rgba(255,53,94,0.10)) 0%, rgba(255,53,94,0.05) 8%, transparent 30%);
    }
}

/* Final enforcement: ensure login inputs use dark background and light text even if other stylesheets apply
   This block is deliberately specific and uses !important to beat other rules and browser autofill. */
body.theme-default .login-card input#user,
body.theme-default .login-card input#clave,
body.theme-default .login-card .custom-form .form-control {
    background: rgba(12, 12, 18, 0.86) !important;
    border: 1px solid #d0d0d0 !important;
    color: rgba(255,255,255,0.95) !important;
}

/* Autofill (Chrome/WebKit) */
body.theme-default .login-card input#user:-webkit-autofill,
body.theme-default .login-card input#clave:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px rgba(12,12,18,0.86) inset !important;
    box-shadow: 0 0 0px 1000px rgba(12,12,18,0.86) inset !important;
    -webkit-text-fill-color: rgba(255,255,255,0.95) !important;
}

/* Placeholder color enforced */
body.theme-default .login-card input::placeholder {
    color: rgba(255,255,255,0.7) !important;
}

/* If the page isn't using body.theme-default, also include a non-themed fallback */
.login-card input#user,
.login-card input#clave,
.login-card .custom-form .form-control {
    background: rgba(12, 12, 18, 0.86) !important;
    border: 1px solid #d0d0d0 !important;
    color: rgba(255,255,255,0.95) !important;
}

.login-card input#user:-webkit-autofill,
.login-card input#clave:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px rgba(12,12,18,0.86) inset !important;
    box-shadow: 0 0 0px 1000px rgba(12,12,18,0.86) inset !important;
    -webkit-text-fill-color: rgba(255,255,255,0.95) !important;
}

.login-card input::placeholder {
    color: rgba(255,255,255,0.7) !important;
}

/* Focus state: border should use red tone and subtle glow */
body.theme-default .login-card input#user:focus,
body.theme-default .login-card input#clave:focus,
body.theme-default .login-card .custom-form .form-control:focus {
    border-color: rgba(255,53,94,0.65) !important;
    /*box-shadow: 0 0 0 3px rgba(229,25,67,0.08) inset !important;*/
    outline: none !important;
}

.login-card input#user:focus,
.login-card input#clave:focus,
.login-card .custom-form .form-control:focus {
    border-color: rgba(255,53,94,0.65) !important;
    /*box-shadow: 0 0 0 3px rgba(229,25,67,0.08) inset !important;*/
    outline: none !important;
}

/* Ensure forgot-password page inputs match login: height and radius + enforced colors */
body.theme-default .login-card .custom-form .form-control,
body.theme-default .login-card input#user,
body.theme-default .login-card input#clave,
body.theme-default .login-card input,
body.theme-default .login-card .password-wrapper input {
    background: rgba(12,12,18,0.86) !important;
    border: 1px solid #d0d0d0 !important;
    color: rgba(255,255,255,0.95) !important;
    height: 54px !important;
    border-radius: 16px !important;
    box-shadow: none !important;
}

body.theme-default .login-card .custom-form .form-control::placeholder,
body.theme-default .login-card input::placeholder {
    color: rgba(255,255,255,0.7) !important;
}

/* Autofill for Chrome/WebKit on all login-card inputs */
body.theme-default .login-card .custom-form .form-control:-webkit-autofill,
body.theme-default .login-card input:-webkit-autofill,
body.theme-default .login-card .password-wrapper input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px rgba(12,12,18,0.86) inset !important;
    box-shadow: 0 0 0 1000px rgba(12,12,18,0.86) inset !important;
    -webkit-text-fill-color: rgba(255,255,255,0.95) !important;
}

/* Focus state enforcement */
body.theme-default .login-card .custom-form .form-control:focus,
body.theme-default .login-card input:focus,
body.theme-default .login-card .password-wrapper input:focus {
    border-color: rgba(255,53,94,0.65) !important;
   /* box-shadow: 0 0 0 3px rgba(229,25,67,0.08) inset !important;*/
    outline: none !important;
}

.form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 8px;
}

.input-wrap {
    position: relative;
}

.icon {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    opacity: 0.78;
}

/* Make space for the inline svg icon and size it for the default theme */
.input-wrap {
    position: relative;
}
.input-wrap .icon {
    left: 12px;
    width: 28px;
    height: 28px;
    opacity: 1;
}
.input-wrap .form-control {
    padding-left: 52px !important; /* leave space for the icon */
}

/* Forgot password link inside login-card: align right under password in default theme */
body.theme-default .login-card .forgot-link {
    display: block;
    width: 100%;
    text-align: right !important;
    margin: 6px 0 8px 0;
    color: rgba(255,255,255,0.78) !important;
    text-decoration: none !important;
    font-size: 0.95rem;
    float: none;
}
body.theme-default .login-card .forgot-link:hover {
    text-decoration: underline;
}

/* Ensure instructional paragraph fills the form and is centered inside the login card for default theme */
body.theme-default .login-card .center-text {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0 0 14px 0;
    box-sizing: border-box;
    color: rgba(255,255,255,0.85);
    padding-right: 0;
    padding-left: 0;
}

.colorIcono{
    color: var(--accent);
}