/* ====================================
   RESET Y CONFIGURACIÓN GENERAL
   ==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f172a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(66, 153, 225, 0.15) 0%, transparent 50%);
}

/* ====================================
   CONTENEDOR PRINCIPAL
   ==================================== */
.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 45px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====================================
   HEADER
   ==================================== */
.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.login-header .subtitle {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 400;
    margin-bottom: 4px;
}

.login-header .company-name {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

/* ====================================
   FORMULARIO
   ==================================== */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
}

.form-group:last-of-type {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    color: white;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-group input::placeholder {
    color: #64748b;
}

/* Ocultar iconos de autocompletar del navegador */
.form-group input::-webkit-credentials-auto-fill-button,
.form-group input::-webkit-contacts-auto-fill-button {
    display: none !important;
    pointer-events: none;
}

.form-group input::-ms-clear,
.form-group input::-ms-reveal {
    display: none !important;
}

/* ====================================
   MENSAJES DE ERROR
   ==================================== */
.error-message {
    display: block;
    font-size: 12px;
    color: #ef4444;
    margin-top: 6px;
    min-height: 18px;
    line-height: 1.4;
}

/* ====================================
   BOTÓN DE ENVÍO
   ==================================== */
.btn-submit {
    width: 100%;
    padding: 15px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #4299e1 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-submit .btn-text,
.btn-submit .btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ====================================
   SPINNER DE CARGA
   ==================================== */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ====================================
   MENSAJES DE ALERTA
   ==================================== */
.alert-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-message.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-message.success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* ====================================
   FOOTER
   ==================================== */
.login-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: #64748b;
}

/* ====================================
   RESPONSIVE
   ==================================== */
@media (max-width: 480px) {
    .login-box {
        padding: 28px 24px;
    }

    .login-header h1 {
        font-size: 22px;
    }

    .login-header .company-name {
        font-size: 14px;
    }

    .form-group input,
    .btn-submit {
        padding: 12px 14px;
    }
}

/* ====================================
   ESTADOS DE ACCESIBILIDAD
   ==================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.btn-submit:focus,
.form-group input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
