/* Reset básico */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* Fondo con degradado y ligeras animaciones */
.login-background {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: radial-gradient(circle at top left, #1e3a8a 0, #020617 40%), 
                radial-gradient(circle at bottom right, #0f766e 0, #020617 45%);
    overflow: hidden;
}

/* capa suave encima del degradado */
.login-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15,23,42,0.5), rgba(15,23,42,0.2));
}

/* contenedor principal */
.login-wrapper {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* tarjeta de login */
.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(15,23,42,0.96);
    border-radius: 18px;
    padding: 28px 28px 24px;
    color: #e5e7eb;
    box-shadow:
        0 18px 45px rgba(0,0,0,0.65),
        0 0 0 1px rgba(148,163,184,0.12);

    /* animación de entrada */
    opacity: 0;
    transform: translateY(20px);
    animation: cardFadeIn 550ms ease-out forwards;
}

/* cabecera: logo + título */
.login-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.login-logo img {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(56,189,248,0.5));
}

.login-title h1 {
    font-size: 20px;
    margin: 0 0 4px;
    font-weight: 600;
}

.login-title p {
    margin: 0;
    font-size: 13px;
    color: #9ca3af;
}

/* alerta de error */
.login-alert {
    background: rgba(239,68,68,0.09);
    border: 1px solid rgba(248,113,113,0.6);
    color: #fecaca;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 18px;
}

/* formulario */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* grupo de campos */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 13px;
    color: #e5e7eb;
}

/* contenedor del input con highlight */
.input-wrapper {
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.8);
    background: rgba(15,23,42,0.95);
    padding: 0;
    display: flex;
    align-items: center;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.input-wrapper:focus-within {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56,189,248,0.6), 0 0 22px rgba(56,189,248,0.3);
    transform: translateY(-1px);
}

/* inputs reales que inyecta Django */
.input-wrapper input {
    width: 100%;
    padding: 10px 12px;
    border: none;
    outline: none;
    background: transparent;
    color: #f9fafb;
    font-size: 14px;
}

.input-wrapper input::placeholder {
    color: #6b7280;
}

/* botón principal */
.btn-primary {
    margin-top: 8px;
    border: none;
    border-radius: 999px;
    padding: 11px 16px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #f9fafb;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 12px 25px rgba(37,99,235,0.55);
    transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 35px rgba(37,99,235,0.75);
    filter: brightness(1.04);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 8px 20px rgba(37,99,235,0.6);
}

/* footer */
.login-footer {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid rgba(55,65,81,0.9);
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #9ca3af;
}

.login-helper-row {
    margin-top: 14px;
    display: flex;
    justify-content: center;
}

.login-link {
    color: #7dd3fc;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
}

.login-link:hover {
    color: #bae6fd;
    text-decoration: underline;
}

.login-helptext {
    margin-top: 6px;
    font-size: 12px;
    color: #cbd5e1;
}

.login-helptext ul {
    margin: 6px 0 0 18px;
    padding: 0;
}

/* Animación de entrada */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .login-card {
        padding: 22px 18px 18px;
        border-radius: 14px;
    }

    .login-title h1 {
        font-size: 18px;
    }
}
