/* ===================================================
   SimpleConta — Login / Reset Password Styles
   Sistema de diseño corporativo v2
   =================================================== */

/* --- Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #1e2a3a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Sutil patrón de fondo para dar profundidad */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(42, 82, 152, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(42, 82, 152, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* --- Contenedor principal --- */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    position: relative;
    padding: 20px;
    z-index: 1;
}

/* --- Card del formulario --- */
.login-form-container {
    background: #ffffff;
    border-radius: 18px;
    padding: 44px 40px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    width: 420px;
    max-width: 100%;
    z-index: 10;
    position: relative;
    animation: fadeIn 0.5s ease-out;
}

/* --- Logo --- */
.login-form .login-logo,
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-form .login-logo img,
.login-logo img {
    max-width: 220px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
}

/* Ocultar título texto (se usa el logo) */
.login-form h1 {
    display: none;
}

/* --- Inputs --- */
.input-group {
    position: relative;
    margin-bottom: 18px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #2a5298;
    z-index: 2;
    display: flex;
    align-items: center;
}

.input-group input {
    width: 100%;
    padding: 14px 16px 14px 50px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #f8fafc;
    transition: all 0.25s ease;
    outline: none;
    color: #1e2a3a;
}

.input-group input:focus {
    border-color: #2a5298;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.12);
}

.input-group input::placeholder {
    color: #94a3b8;
}

/* --- Checkbox --- */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 22px;
    font-size: 13px;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: #2a5298;
    cursor: pointer;
}

.checkbox-group label {
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

/* --- Botón principal (Login / Enviar / Registrar) --- */
.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(42, 82, 152, 0.35);
    background: linear-gradient(135deg, #3b6bc4 0%, #2a5298 100%);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.25);
}

.login-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* --- Enlace recuperar contraseña --- */
.forgot-password {
    text-align: center;
    margin-top: 18px;
}

.forgot-password a {
    color: #2a5298;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password a:hover {
    color: #3b82f6;
    text-decoration: underline;
}

/* --- Separador --- */
.login-separator {
    margin: 24px 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
}

/* --- Sección registro nuevo --- */
.new-company-section {
    text-align: center;
}

.new-company-section p {
    color: #64748b;
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.register-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: #ffffff;
    color: #2a5298;
    border: 2px solid #2a5298;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
}

.register-btn:hover {
    background: #f0f5ff;
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.15);
}

/* --- Footer login --- */
.login-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}

.login-footer p {
    margin: 0;
}

.login-footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-footer a:hover {
    color: #64748b;
}

/* --- Mensajes (success / error) --- */
.message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    text-align: center;
    font-size: 13.5px;
    font-weight: 500;
    display: none;
    line-height: 1.5;
}

.message.success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* --- Formulario de Recuperación --- */
#forgotForm h2,
#forgot-view h2 {
    color: #1e2a3a;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
}

#forgotForm p,
#forgot-view p {
    color: #64748b;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
}

/* --- Enlace de recuperación --- */
.reset-link {
    margin-top: 16px;
    padding: 16px;
    background: #f0f5ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    text-align: center;
}

.reset-link-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reset-link-btn {
    display: inline-block;
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.25s ease;
    margin: 8px 0;
}

.reset-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(42, 82, 152, 0.3);
    color: #ffffff;
    text-decoration: none;
}

.reset-note {
    color: #64748b;
    font-style: italic;
    font-size: 13px;
}

/* --- Reset Password: requisitos y fuerza --- */
.password-requirements {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin: 16px 0;
    font-size: 13.5px;
}

.password-requirements h4 {
    color: #1e2a3a;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
}

.password-requirements ul {
    margin: 0;
    padding-left: 20px;
    color: #64748b;
}

.password-requirements li {
    margin-bottom: 4px;
}

.password-strength {
    margin-top: 10px;
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.strength-weak {
    background: #ef4444;
    width: 25%;
}

.strength-fair {
    background: #f59e0b;
    width: 50%;
}

.strength-good {
    background: #059669;
    width: 75%;
}

.strength-strong {
    background: #2a5298;
    width: 100%;
}

/* --- Animaciones --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Efecto shake para errores */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Efectos de focus mejorados */
.input-group.focused {
    transform: scale(1.01);
    transition: transform 0.2s ease;
}

.input-group.focused input {
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.15);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .login-container {
        padding: 16px;
    }

    .login-form-container {
        width: 100%;
        max-width: 420px;
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {
    .login-form-container {
        padding: 28px 20px;
    }

    .input-group input {
        padding: 12px 12px 12px 44px;
        font-size: 14px;
    }

    .login-btn {
        padding: 13px;
        font-size: 14px;
    }

    .reset-link-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}