* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    height: 100vh;
    background: url("../assets/img/FERRETERIA.jpg") no-repeat center center fixed;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.login-container {
    background: #fff;
    width: 400px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.6s ease-in-out;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #2a5298;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    transition: 0.3s;
}

.form-group input:focus {
    border-color: #2a5298;
    outline: none;
    box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.2);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #2a5298;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-login:hover {
    background: #1e3c72;
}

.alert {
    background: #ffdddd;
    color: #a94442;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    margin-bottom: 15px;
    font-size: 14px;
}

.footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #888;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .login-container {
        width: 90%;
        padding: 25px;
    }
}

/* ===== Rediseño moderno del login (override) ===== */

body {
    min-height: 100vh;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: url("../assets/img/FERRETERIA.jpg") no-repeat center center fixed;
    background-size: cover;
}

body::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 10%, rgba(34, 197, 94, 0.16), transparent 55%),
        radial-gradient(circle at 80% 30%, rgba(96, 165, 250, 0.18), transparent 55%),
        linear-gradient(180deg, rgba(2, 6, 23, 0.55), rgba(2, 6, 23, 0.75));
    z-index: 0;
    pointer-events: none;
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 460px;
    padding: 40px 44px 28px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), rgba(15, 23, 42, 0.94)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.85),
        0 0 0 1px rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: fadeIn 0.7s ease-out;
    z-index: 1;
}

.login-container::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.7), rgba(34, 197, 94, 0.7));
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    opacity: 0.55;
    pointer-events: none;
}

.login-container h2 {
    position: relative;
    text-align: center;
    margin-bottom: 26px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #e5e7eb;
}

.login-container h2 i {
    margin-right: 8px;
    color: #60a5fa;
}

.login-container h2::after {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    margin: 12px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #60a5fa, #22c55e);
}

.login-subtitle {
    margin: -14px 0 22px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(229, 231, 235, 0.8);
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.form-group input {
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.96));
    color: #e5e7eb;
    font-size: 0.92rem;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        transform 0.1s ease;
}

.form-group input::placeholder {
    color: #6b7280;
}

.form-group input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow:
        0 0 0 1px rgba(37, 99, 235, 0.8),
        0 0 0 6px rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: rgba(156, 163, 175, 0.9);
    pointer-events: none;
    z-index: 2;
}

.input-wrapper input,
.password-wrapper input {
    padding-left: 38px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    margin-top: 4px;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    color: #f9fafb;
    background-image: linear-gradient(135deg, #22c55e, #16a34a, #0f766e);
    box-shadow:
        0 18px 35px rgba(22, 163, 74, 0.45),
        0 0 0 1px rgba(21, 128, 61, 0.6);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        filter 0.15s ease;
}

.btn-login:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow:
        0 22px 45px rgba(22, 163, 74, 0.6),
        0 0 0 1px rgba(21, 128, 61, 0.85);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow:
        0 10px 24px rgba(21, 128, 61, 0.7),
        0 0 0 1px rgba(21, 128, 61, 0.9);
}

.alert {
    position: relative;
    margin-bottom: 16px;
    padding: 10px 11px 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(248, 113, 113, 0.7);
    background: radial-gradient(circle at top left, rgba(248, 113, 113, 0.18), rgba(15, 23, 42, 0.96));
    color: #fecaca;
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.alert::before {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(248, 113, 113, 0.9);
    color: #111827;
    flex-shrink: 0;
}

.footer {
    margin-top: 22px;
    text-align: center;
    font-size: 0.78rem;
    color: #9ca3af;
    letter-spacing: 0.04em;
}

/* Animación suave al tener errores */
.login-container.shake {
    animation: shake 0.4s ease, fadeIn 0.7s ease-out;
}

@keyframes shake {

    10%,
    90% {
        transform: translateX(-2px);
    }

    20%,
    80% {
        transform: translateX(4px);
    }

    30%,
    50%,
    70% {
        transform: translateX(-6px);
    }

    40%,
    60% {
        transform: translateX(6px);
    }
}

@media (max-width: 640px) {
    body {
        padding: 18px;
    }

    .login-container {
        padding: 26px 22px 20px;
        border-radius: 16px;
    }

    .login-container h2 {
        font-size: 1.22rem;
    }
}

@media (max-width: 390px) {
    .login-container {
        padding-inline: 18px;
    }

    .btn-login {
        font-size: 0.9rem;
    }
}

/* ===== FIX ICONO OJO PASSWORD ===== */

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding-right: 45px;
    /* espacio para el ojo */
    position: relative;
    z-index: 1;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #9ca3af;
    font-size: 16px;
    transition: color 0.2s ease;
    background: transparent;
    border: 0;
    padding: 0;
    z-index: 2;
}

.toggle-password:hover {
    color: #60a5fa;
}

.toggle-password:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.9);
    outline-offset: 2px;
    border-radius: 999px;
}

.toggle-password i {
    pointer-events: none;
}