/* =========================
   RESET BASE
========================= */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

* {
    box-sizing: border-box;
}

/* =========================
   TOKENS DE TEMA (oscuro por defecto, se sobrescriben en modo claro)
========================= */
:root {
    --login-overlay-1: rgba(8, 15, 30, 0.58);
    --login-overlay-2: rgba(8, 15, 30, 0.74);
    --login-radial-1: rgba(59, 130, 246, 0.18);
    --login-radial-2: rgba(6, 182, 212, 0.14);
    --login-radial-bg: rgba(0, 0, 0, 0.24);

    --login-card-bg: rgba(15, 23, 42, 0.80);
    --login-card-border: rgba(255, 255, 255, 0.10);
    --login-card-shadow: rgba(0, 0, 0, 0.40);

    --login-text: #ffffff;
    --login-text-muted: rgba(255, 255, 255, 0.72);
    --login-text-muted-2: rgba(255, 255, 255, 0.60);

    --login-input-bg: rgba(255, 255, 255, 0.07);
    --login-input-bg-focus: rgba(255, 255, 255, 0.10);
    --login-input-border: rgba(255, 255, 255, 0.10);
    --login-input-text: #ffffff;
    --login-placeholder: rgba(255, 255, 255, 0.62);
    --login-icon: rgba(255, 255, 255, 0.58);

    --login-demo-border: rgba(255, 255, 255, 0.16);
    --login-demo-bg: rgba(255, 255, 255, 0.04);
    --login-demo-bg-hover: rgba(255, 255, 255, 0.09);

    --login-social-bg: rgba(255, 255, 255, 0.06);
    --login-social-border: rgba(255, 255, 255, 0.10);
    --login-social-color: rgba(255, 255, 255, 0.88);

    --login-footer: rgba(255, 255, 255, 0.60);

    --login-toggle-bg: rgba(255, 255, 255, 0.10);
    --login-toggle-border: rgba(255, 255, 255, 0.16);
    --login-toggle-color: #ffffff;
}

html[data-bs-theme="light"] {
    --login-overlay-1: rgba(248, 250, 252, 0.55);
    --login-overlay-2: rgba(248, 250, 252, 0.78);
    --login-radial-1: rgba(59, 130, 246, 0.14);
    --login-radial-2: rgba(6, 182, 212, 0.10);
    --login-radial-bg: rgba(255, 255, 255, 0.10);

    --login-card-bg: rgba(255, 255, 255, 0.92);
    --login-card-border: rgba(15, 23, 42, 0.08);
    --login-card-shadow: rgba(15, 23, 42, 0.16);

    --login-text: #0f172a;
    --login-text-muted: rgba(15, 23, 42, 0.80);
    --login-text-muted-2: rgba(15, 23, 42, 0.68);

    --login-input-bg: rgba(15, 23, 42, 0.04);
    --login-input-bg-focus: rgba(15, 23, 42, 0.06);
    --login-input-border: rgba(15, 23, 42, 0.12);
    --login-input-text: #0f172a;
    --login-placeholder: rgba(15, 23, 42, 0.60);
    --login-icon: rgba(15, 23, 42, 0.65);

    --login-demo-border: rgba(15, 23, 42, 0.14);
    --login-demo-bg: rgba(15, 23, 42, 0.03);
    --login-demo-bg-hover: rgba(15, 23, 42, 0.06);

    --login-social-bg: rgba(15, 23, 42, 0.05);
    --login-social-border: rgba(15, 23, 42, 0.10);
    --login-social-color: rgba(15, 23, 42, 0.85);

    --login-footer: rgba(15, 23, 42, 0.65);

    --login-toggle-bg: rgba(15, 23, 42, 0.06);
    --login-toggle-border: rgba(15, 23, 42, 0.12);
    --login-toggle-color: #0f172a;
}

/* =========================
   BODY / FONDO
========================= */
body {
    font-family: "Segoe UI", "Inter", Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px 14px;
    position: relative;
    overflow-x: hidden;
    transition: background 0.25s ease;

    background:
        linear-gradient(var(--login-overlay-1), var(--login-overlay-2)),
        url("../img/fondo_llanta1.jpg") no-repeat center center / cover;
    background-attachment: scroll;
}

body::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, var(--login-radial-1), transparent 28%),
        radial-gradient(circle at top right, var(--login-radial-2), transparent 30%),
        var(--login-radial-bg);
    backdrop-filter: blur(7px);
    z-index: 0;
    transition: background 0.25s ease;
}

/* =========================
   BOTÓN DE TEMA
========================= */
.login-theme-btn {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 5;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--login-toggle-border);
    background: var(--login-toggle-bg);
    color: var(--login-toggle-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, background 0.2s ease;
}

.login-theme-btn:hover {
    transform: translateY(-2px);
}

/* =========================
   ENVOLTURA
========================= */
.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* =========================
   CARD LOGIN
========================= */
.login-container {
    width: min(100%, 430px);
    background: var(--login-card-bg);
    border: 1px solid var(--login-card-border);
    border-radius: 26px;
    padding: 32px 24px 22px;
    text-align: center;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 46px var(--login-card-shadow);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* =========================
   LOGO
========================= */
.login-logo {
    width: 74px;
    height: 74px;
    margin: 0 auto 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.34);
}

.login-logo i {
    font-size: 29px;
    color: #fff;
}

/* =========================
   TITULOS
========================= */
.login-title {
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 800;
    color: var(--login-text);
    letter-spacing: 0.2px;
}

.login-subtitle {
    margin: 12px 0 22px;
    color: var(--login-text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

/* =========================
   MENSAJES
========================= */
.messages-box {
    margin-bottom: 16px;
}

.alert-custom {
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.45;
    font-weight: 500;
}

.alert-success-custom {
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.32);
    color: #ecfdf3;
}

.alert-warning-custom {
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.32);
    color: #fff6e6;
}

.alert-error-custom {
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.32);
    color: #fff2f2;
}

html[data-bs-theme="light"] .alert-success-custom {
    color: #14532d;
}

html[data-bs-theme="light"] .alert-warning-custom {
    color: #78350f;
}

html[data-bs-theme="light"] .alert-error-custom {
    color: #7f1d1d;
}

/* =========================
   FORM
========================= */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =========================
   INPUTS CON ICONO
========================= */
.input-group-custom {
    position: relative;
}

.input-group-custom i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--login-icon);
    font-size: 16px;
    pointer-events: none;
}

.input-group-custom input {
    width: 100%;
    padding: 14px 15px 14px 44px;
    border: 1px solid var(--login-input-border);
    border-radius: 15px;
    background: var(--login-input-bg);
    color: var(--login-input-text);
    font-size: 16px;
    transition: all .25s ease;
}

.input-group-custom input::placeholder {
    color: var(--login-placeholder);
}

.input-group-custom input:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.50);
    background: var(--login-input-bg-focus);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

/* =========================
   BOTÓN PRINCIPAL
========================= */
.login-btn-primary {
    width: 100%;
    margin-top: 6px;
    padding: 14px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all .25s ease;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.login-btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.34);
}

/* =========================
   LINK DEMO
========================= */
.login-demo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 14px;
    text-decoration: none;
    border: 1px solid var(--login-demo-border);
    background: var(--login-demo-bg);
    color: var(--login-text);
    font-size: 14px;
    font-weight: 600;
    transition: all .22s ease;
}

.login-demo-link i {
    color: #2563eb;
    font-size: 14px;
}

.login-demo-link:hover {
    background: var(--login-demo-bg-hover);
    border-color: rgba(37, 99, 235, 0.38);
}

/* =========================
   TEXTO AUXILIAR
========================= */
.login-helper-text {
    margin: 14px 0 0;
    text-align: center;
    font-size: 13.5px;
    color: var(--login-text-muted);
    font-weight: 500;
}

/* =========================
   REDES / SOPORTE
========================= */
.login-social-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.login-social-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.15rem;
    color: var(--login-social-color);
    background: var(--login-social-bg);
    border: 1px solid var(--login-social-border);
    transition: all .24s ease;
}

.login-social-btn:hover {
    transform: translateY(-2px);
    color: #fff;
}

.whatsapp-btn:hover {
    background: #25D366;
    border-color: #25D366;
    box-shadow: 0 12px 24px rgba(37, 211, 102, 0.24);
}

.instagram-btn:hover {
    background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(221, 42, 123, 0.24);
}

/* =========================
   FOOTER
========================= */
.footer {
    margin: 18px 0 0;
    font-size: 12px;
    color: var(--login-footer);
    line-height: 1.5;
}

/* =========================
   TABLET / DESKTOP
========================= */
@media (min-width: 769px) {
    body {
        padding: 24px;
    }

    .login-container {
        padding: 36px 30px 24px;
    }

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

/* =========================
   MÓVIL
========================= */
@media (max-width: 480px) {
    body {
        padding: 18px 10px;
        align-items: center;
    }

    .login-container {
        width: calc(100vw - 20px);
        padding: 28px 16px 20px;
        border-radius: 22px;
    }

    .login-logo {
        width: 68px;
        height: 68px;
        border-radius: 18px;
        margin-bottom: 14px;
    }

    .login-logo i {
        font-size: 27px;
    }

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

    .login-subtitle {
        font-size: 13.5px;
        margin-bottom: 18px;
    }

    .input-group-custom input {
        font-size: 16px;
    }

    .login-btn-primary,
    .login-demo-link {
        font-size: 15px;
    }

    .login-social-row {
        gap: 10px;
        margin-top: 16px;
    }

    .login-social-btn {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .login-theme-btn {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }
}



/* ===== Cuenta bloqueada ===== */
.login-bloqueado {
    text-align: center;
    padding: 1.5rem 1.25rem;
    border-radius: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    margin-bottom: 1rem;
}
.login-bloqueado-icono {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    color: #dc2626;
    background: #fee2e2;
}
.login-bloqueado-titulo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #991b1b;
    margin: 0 0 0.5rem;
}
.login-bloqueado-texto {
    font-size: 0.92rem;
    line-height: 1.5;
    color: #7f1d1d;
    margin: 0 0 1.25rem;
}
.login-bloqueado-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: #16a34a;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}
.login-bloqueado-btn:hover { background: #15803d; color: #fff; }
.login-bloqueado-btn:active { transform: scale(0.98); }
.login-bloqueado-volver {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.9rem;
    font-size: 0.85rem;
    color: #7f1d1d;
    text-decoration: none;
    opacity: 0.8;
}
.login-bloqueado-volver:hover { opacity: 1; text-decoration: underline; }

/* Tema oscuro */
[data-bs-theme="dark"] .login-bloqueado {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(248, 113, 113, 0.3);
}
[data-bs-theme="dark"] .login-bloqueado-icono {
    background: rgba(220, 38, 38, 0.18);
    color: #f87171;
}
[data-bs-theme="dark"] .login-bloqueado-titulo { color: #fca5a5; }
[data-bs-theme="dark"] .login-bloqueado-texto,
[data-bs-theme="dark"] .login-bloqueado-volver { color: #fecaca; }


/* ===== Ojito para mostrar contraseña ===== */
.input-group-custom.input-password {
    position: relative;
}
.input-group-custom.input-password input {
    padding-right: 2.75rem !important;
}
.input-group-custom .login-ver-pass {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #6c757d !important;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.3rem 0.45rem;
    border-radius: 8px;
    cursor: pointer;
    width: auto;
    height: auto;
}
.input-group-custom .login-ver-pass i {
    position: static !important;
    color: inherit !important;
    margin: 0 !important;
}
.input-group-custom .login-ver-pass:hover {
    color: #212529 !important;
    background: rgba(0, 0, 0, 0.05) !important;
}
[data-bs-theme="dark"] .input-group-custom .login-ver-pass { color: #adb5bd !important; }
[data-bs-theme="dark"] .input-group-custom .login-ver-pass:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Oculta el ojito nativo de Microsoft Edge */
.input-group-custom input::-ms-reveal,
.input-group-custom input::-ms-clear { display: none; }